* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a1a;
    min-height: 100vh;
    color: #e0e0e0;
}

.container {
    height: 100vh;
    padding: 0;
    max-width: none;
}

.main-content {
    display: flex;
    gap: 0;
    background: #2d2d2d;
    height: 100vh;
    overflow: hidden;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.sidebar {
    width: 320px;
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
    padding: 0;
    border-right: 2px solid #333;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
}

.sidebar header {
    text-align: center;
    margin-bottom: 0;
    padding: 25px 20px 20px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-bottom: 3px solid #004085;
    position: relative;
    overflow: hidden;
}

.sidebar header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.03)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.03)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.02)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.sidebar header h1 {
    color: #ffffff;
    font-size: 1.6rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    margin: 0;
    position: relative;
    z-index: 1;
    letter-spacing: -0.5px;
}


.view-section {
    padding: 25px 20px;
    background: rgba(20,20,20,0.96);
    border-bottom: 1.5px solid #232323;
}

.view-section h3 {
    margin-bottom: 20px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #333;
    position: relative;
}

.view-section h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background: #007bff;
}

.controls {
    padding: 20px;
    background: rgba(20,20,20,0.96);
    border-top: 1.5px solid #232323;
    margin-top: auto;
}

.controls .btn {
    margin-bottom: 12px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
    position: relative;
    overflow: hidden;
}

.controls .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.controls .btn:hover::before {
    left: 100%;
}

.controls h3 {
    margin-bottom: 15px;
    color: #ffffff;
    font-size: 1.1rem;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
    width: 100%;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    border: 2px solid #1e7e34;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #218838 0%, #155724 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    width: 100%;
    margin-bottom: 12px;
    box-shadow: 0 3px 10px rgba(108, 117, 125, 0.2);
    border: 2px solid #495057;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #343a40 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

.btn-small {
    padding: 8px 12px;
    font-size: 12px;
    margin-left: 10px;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.criteria-section, .view-section {
    margin-bottom: 30px;
}

.view-section h3 {
    margin-bottom: 15px;
    color: #ffffff;
    font-size: 1.1rem;
}

.view-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.view-buttons .btn-view:nth-child(5) {
    grid-column: 1 / -1;
}

.btn-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 10px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%);
    border: 2px solid #404040;
    color: #b0b0b0;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    min-height: 70px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.btn-view::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0,123,255,0.1) 0%, rgba(0,86,179,0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-view:hover {
    border-color: #007bff;
    color: #007bff;
    background: linear-gradient(135deg, #404040 0%, #333333 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
}

.btn-view:hover::before {
    opacity: 1;
}

.btn-view.active-view {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
    border-color: #004085 !important;
    color: white !important;
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4) !important;
    transform: translateY(-2px) scale(1.05);
}

.btn-view.active-view::before {
    opacity: 0;
}

.view-icon {
    font-size: 24px;
    margin-bottom: 6px;
    display: block;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.btn-view:hover .view-icon {
    transform: scale(1.15) rotate(8deg);
    filter: drop-shadow(0 3px 6px rgba(0,123,255,0.3));
}

.btn-view.active-view .view-icon {
    transform: scale(1.1);
    text-shadow: 0 2px 6px rgba(0,0,0,0.4);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.view-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    transition: all 0.3s ease;
    opacity: 0.9;
}

.btn-view:hover .view-label {
    transform: translateY(-2px);
    opacity: 1;
    letter-spacing: 1px;
}

.btn-view.active-view .view-label {
    opacity: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Special effects for each view type */
.btn-view:nth-child(1):hover .view-icon { /* List */
    animation: listPulse 0.6s ease infinite;
}

.btn-view:nth-child(2):hover .view-icon { /* Tree */
    animation: treeSway 1s ease infinite;
}

.btn-view:nth-child(3):hover .view-icon { /* Grid */
    animation: gridExpand 0.8s ease infinite;
}

.btn-view:nth-child(4):hover .view-icon { /* ELO */
    animation: graphRise 1s ease infinite;
}

@keyframes listPulse {
    0%, 100% { transform: scale(1.1); }
    50% { transform: scale(1.2); }
}

@keyframes treeSway {
    0%, 100% { transform: scale(1.1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-3deg); }
    75% { transform: scale(1.1) rotate(3deg); }
}

@keyframes gridExpand {
    0%, 100% { transform: scale(1.1); }
    50% { transform: scale(1.15); }
}

@keyframes graphRise {
    0%, 100% { transform: scale(1.1) translateY(0); }
    50% { transform: scale(1.1) translateY(-2px); }
}

.criteria-list {
    list-style: none;
    margin-bottom: 15px;
}

.criteria-list li {
    padding: 8px 12px;
    background: white;
    margin-bottom: 5px;
    border-radius: 5px;
    border: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.criteria-controls {
    display: flex;
    align-items: center;
}

.criteria-controls input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    font-size: 14px;
}

.remove-criteria {
    background: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.rankings {
    flex: 1;
    padding: 20px;
    height: 100vh;
    overflow-y: auto;
    background: #2d2d2d;
}

.rankings h2 {
    margin-bottom: 30px;
    color: #ffffff;
    font-size: 1.8rem;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

.films-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.film-item {
    display: flex;
    align-items: center;
    padding: 20px;
    background: #333333;
    border: 1px solid #505050;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: transform 0.2s ease;
}

.film-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.film-rank {
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
    margin-right: 20px;
    min-width: 50px;
}

.tied-rank {
    color: #ff9500;
    position: relative;
}

.tied-rank::after {
    content: '🔗';
    position: absolute;
    top: -5px;
    right: -15px;
    font-size: 0.8rem;
}

.tied-item {
    border-left: 4px solid #ff9500;
    background: #3a3a3a;
}

.tie-explanation {
    background: #404040;
    border: 1px solid #606060;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: #ffd700;
    font-size: 0.9rem;
    text-align: center;
}

.film-info {
    flex: 1;
}

.film-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 8px;
}

.film-details {
    color: #b0b0b0;
    font-size: 0.9rem;
}

.film-thumbnail {
    width: 80px;
    height: 60px;
    background: #404040;
    border-radius: 5px;
    margin-right: 15px;
    background-size: cover;
    background-position: center;
    border: 1px solid #606060;
}

.clickable-thumbnail {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.clickable-thumbnail:hover {
    transform: scale(1.05);
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.clickable-thumbnail:hover::after {
    content: "🔍";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.film-actions {
    display: flex;
    gap: 10px;
}

.film-actions .btn {
    padding: 8px 15px;
    font-size: 12px;
    margin: 0;
}

.empty-state {
    text-align: center;
    color: #888888;
    font-size: 1.1rem;
    padding: 50px;
    background: #2a2a2a;
    border-radius: 10px;
    border: 2px dashed #555555;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #2d2d2d;
    margin: 3% auto;
    padding: 0;
    border-radius: 15px;
    width: 98%;
    max-width: 900px;
    min-width: 600px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    animation: modalAppear 0.3s ease;
    border: 1px solid #505050;
}

@keyframes modalAppear {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #505050;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: #ffffff;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #ffffff;
}

.modal-body {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #ffffff;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #505050;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    background: #1f1f1f;
    color: #ffffff;
}

.form-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.thumbnail-preview {
    margin-top: 10px;
    width: 100%;
    height: 120px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.thumbnail-preview.has-image {
    border-style: solid;
    border-color: #28a745;
}

.preview-placeholder {
    color: #6c757d;
    font-size: 0.9rem;
    text-align: center;
    padding: 20px;
}

.thumbnail-preview.has-image .preview-placeholder {
    display: none;
}

.thumbnail-error {
    border-color: #dc3545 !important;
    background-color: #f8d7da !important;
}

.thumbnail-error .preview-placeholder {
    color: #721c24;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.thumbnail-preview:hover .image-overlay {
    opacity: 1;
}

/* Checkbox styles */
.checkbox-label {
    display: flex !important;
    align-items: center;
    cursor: pointer;
    margin-bottom: 0 !important;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-label .checkmark {
    width: 20px;
    height: 20px;
    background-color: #1f1f1f;
    border: 2px solid #505050;
    border-radius: 4px;
    margin-right: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background-color: #007bff;
    border-color: #007bff;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: "✓";
    position: absolute;
    left: 4px;
    top: 0px;
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.checkbox-label:hover .checkmark {
    border-color: #007bff;
}

/* Input hint styles */
.input-hint {
    margin-top: 5px;
    font-size: 12px;
    color: #888;
    font-style: italic;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #505050;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.modal-footer .btn {
    margin: 0;
    padding: 12px 25px;
}

/* Comparison Modal Styles */
.comparison-content {
    text-align: center;
}

.film-comparison {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 40px;
    margin-bottom: 30px;
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.film-card {
    text-align: center;
    padding: 20px;
    border: 2px solid #505050;
    border-radius: 12px;
    background: #333333;
    min-width: 280px;
    min-height: 320px;
    max-width: 320px;
    max-height: 380px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.clickable-card {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid #505050;
}

.clickable-card:hover {
    border-color: #007bff;
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
    background: #404040;
}

.clickable-card:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.film-card h3 {
    margin-bottom: 15px;
    color: #ffffff;
}

.thumbnail {
    width: 120px;
    height: 90px;
    background: #404040;
    border-radius: 8px;
    margin: 0 auto;
    background-size: cover;
    background-position: center;
    border: 1px solid #606060;
}

.vs {
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
    padding: 20px;
    background: #2d2d2d;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border: 2px solid #007bff;
}

.comparison-question {
    font-size: 1.2rem;
    color: #ffffff;
    margin-bottom: 30px;
    line-height: 1.5;
}

.comparison-controls {
    text-align: center;
    margin-top: 20px;
}

.comparison-controls .btn {
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.comparison-controls .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .film-comparison {
        flex-direction: column;
        gap: 20px;
    }
    
    .vs {
        transform: rotate(90deg);
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.btn.loading {
    position: relative;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* View Mode Styles */
.active-view {
    background: #007bff !important;
    color: white !important;
}

/* Tree View Styles */
.tree-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    padding: 20px;
}

.tree-level {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    width: 100%;
}

.tree-node {
    background: white;
    border: 2px solid #007bff;
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    min-width: 150px;
    max-width: 200px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
}

.tree-node.winner {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    border-color: #ffa500;
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
}

.tree-node.tied {
    background: linear-gradient(135deg, #ff9500, #ffb347);
    border-color: #ff7700;
}

.tree-node .node-rank {
    font-size: 1.2rem;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 10px;
}

.tree-node.winner .node-rank {
    color: #d4af37;
}

.tree-node.tied .node-rank {
    color: #cc5500;
}

.tree-node .node-thumbnail {
    width: 80px;
    height: 60px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 0 auto 10px;
    background-size: cover;
    background-position: center;
}

.tree-node .node-title {
    font-size: 0.9rem;
    font-weight: bold;
    color: #333;
    line-height: 1.2;
    margin-bottom: 5px;
}

.tree-node .node-wins {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Grid View Styles */
.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    padding: 20px;
}

.grid-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.grid-item.tied-grid-item {
    border: 3px solid #ff9500;
}

.grid-thumbnail {
    width: 100%;
    height: 120px;
    background: #f8f9fa;
    background-size: cover;
    background-position: center;
    position: relative;
}

.grid-rank {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 123, 255, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

.grid-rank.tied-grid-rank {
    background: rgba(255, 149, 0, 0.9);
}

.grid-info {
    padding: 12px;
    text-align: center;
}

.grid-title {
    font-size: 0.9rem;
    font-weight: bold;
    color: #333;
    line-height: 1.2;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.grid-wins {
    font-size: 0.75rem;
    color: #6c757d;
}

.grid-actions {
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 8px;
    background: #f8f9fa;
}

.grid-actions .btn {
    padding: 4px 8px;
    font-size: 0.7rem;
    margin: 0;
}

/* ELO View Styles */
.elo-explanation {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: #1565c0;
    font-size: 0.9rem;
    text-align: center;
}

.elo-item {
    position: relative;
    overflow: hidden;
}

.elo-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--elo-color, #007bff);
}

.elo-rank {
    position: relative;
}

.elo-rating {
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* ELO Rating Classes */
.elo-master {
    color: #9c27b0 !important;
    --elo-color: #9c27b0;
}

.elo-master.elo-rating {
    background: rgba(156, 39, 176, 0.1);
    color: #9c27b0 !important;
}

.elo-expert {
    color: #ff9800 !important;
    --elo-color: #ff9800;
}

.elo-expert.elo-rating {
    background: rgba(255, 152, 0, 0.1);
    color: #ff9800 !important;
}

.elo-intermediate {
    color: #4caf50 !important;
    --elo-color: #4caf50;
}

.elo-intermediate.elo-rating {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50 !important;
}

.elo-beginner {
    color: #757575 !important;
    --elo-color: #757575;
}

.elo-beginner.elo-rating {
    background: rgba(117, 117, 117, 0.1);
    color: #757575 !important;
}

/* Floating Add Button */
.floating-add-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #007bff;
    border: none;
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-add-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 123, 255, 0.6);
    background: #0056b3;
}

.floating-add-btn:active {
    transform: scale(0.95);
}

.floating-add-btn span {
    line-height: 1;
}

/* Detail View Styles */
.detail-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    min-height: 500px;
}

.detail-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
}

.nav-btn {
    padding: 10px 15px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100px;
    min-width: 100px;
}

.nav-btn:hover:not(:disabled) {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.nav-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.nav-btn-first,
.nav-btn-last {
    background: #28a745;
    width: 100px;
    min-width: 100px;
}

.nav-btn-first:hover:not(:disabled),
.nav-btn-last:hover:not(:disabled) {
    background: #218838;
}

.film-counter {
    background: #f8f9fa;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    border: 2px solid #dee2e6;
}

.detail-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    padding: 30px;
    max-width: 800px;
    width: 100%;
    text-align: center;
}

.detail-header {
    margin-bottom: 25px;
}

.detail-rank {
    font-size: 2rem;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 10px;
}

.detail-rank.tied-rank {
    color: #ff9500;
}

.detail-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    line-height: 1.3;
}

.detail-thumbnail {
    width: 300px;
    height: 200px;
    background: #f8f9fa;
    border-radius: 12px;
    margin: 0 auto 25px;
    background-size: cover;
    background-position: center;
    border: 3px solid #dee2e6;
    transition: all 0.3s ease;
}

.detail-thumbnail:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.clickable-film-thumbnail {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.clickable-film-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}

.clickable-film-thumbnail:hover::after {
    content: "▶ Click to Watch";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    pointer-events: none;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.detail-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.detail-toggle-section {
    text-align: center;
    margin-bottom: 20px;
}

.detail-toggle-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #e0e0e0;
    opacity: 1;
}

.detail-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.detail-sections {
    transition: all 0.3s ease;
}

.stat-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #dee2e6;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 5px;
    font-weight: 500;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: bold;
    color: #333;
}

.stat-value.elo-rating {
    font-size: 1.2rem;
    padding: 4px 8px;
    border-radius: 6px;
}

.matchups-section {
    text-align: left;
}

.matchups-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

.matchups-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.matchup-category {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #dee2e6;
}

.matchup-category.wins {
    border-left: 4px solid #28a745;
}

.matchup-category.losses {
    border-left: 4px solid #dc3545;
}

.matchup-header {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.matchup-header.wins {
    color: #28a745;
}

.matchup-header.losses {
    color: #dc3545;
}

.matchup-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.matchup-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.matchup-item:last-child {
    border-bottom: none;
}

.matchup-thumbnail {
    width: 40px;
    height: 30px;
    background: #dee2e6;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.matchup-name {
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
    flex: 1;
}

.matchup-actions {
    display: flex;
    gap: 5px;
    align-items: center;
}

.matchup-actions .btn-small {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 4px;
    margin: 0;
    min-width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.matchup-actions .btn-danger {
    background: #dc3545;
    color: white;
}

.matchup-actions .btn-danger:hover {
    background: #c82333;
}

.matchup-actions .btn-secondary {
    background: #6c757d;
    color: white;
}

.matchup-actions .btn-secondary:hover {
    background: #5a6268;
}

.add-matchup-section {
    background: #e9ecef;
    border-radius: 10px;
    padding: 20px;
    margin-top: 25px;
    border: 1px solid #dee2e6;
    border-left: 4px solid #007bff;
}

.add-matchup-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.matchup-select {
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    color: #333;
}

.matchup-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.matchup-result-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.detail-actions {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.detail-actions .btn {
    flex: 1;
    width: 130px;
    min-width: 130px;
    max-width: 130px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 10px;
    box-sizing: border-box;
}

.empty-matchups {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
}

/* Responsive adjustments for detail view */
@media (max-width: 768px) {
    .detail-thumbnail {
        width: 250px;
        height: 160px;
    }
    
    .matchups-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .detail-navigation {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .film-counter {
        order: -1;
        width: 100%;
        text-align: center;
    }
}
