/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    color: #1a202c;
    overflow-x: auto;
    min-height: 100vh;
}

.container {
    min-width: 1200px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 16px;
    padding: 12px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 4px;
}

header p {
    font-size: 0.875rem;
    color: #718096;
    margin-bottom: 12px;
}

.reset-btn {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.reset-btn:hover {
    background: #c53030;
    transform: translateY(-1px);
}

.recalculate-btn:hover {
    background: #3182ce !important;
}

.header-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
}

.save-btn:hover {
    background: #38a169 !important;
}

/* Columns Layout */
.columns-container {
    display: grid;
    grid-template-columns: 280px repeat(5, 1fr);
    gap: 12px;
    height: 75vh;
    min-height: 600px;
}

.column {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Column Headers */
.column-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
}

.column-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: white;
}

.column-header .count {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

/* Movies Column */
.movies-column .column-header {
    background: #4a5568;
}

.movies-column .column-header h2 {
    color: white;
}

/* Ranking Column Headers */
.top-tier {
    background: linear-gradient(135deg, #48bb78, #38a169);
}

.very-good {
    background: linear-gradient(135deg, #4299e1, #3182ce);
}

.good {
    background: linear-gradient(135deg, #ed8936, #dd6b20);
}

.neutral {
    background: linear-gradient(135deg, #a0aec0, #718096);
}

.bad {
    background: linear-gradient(135deg, #f56565, #e53e3e);
}

/* Column Content */
.column-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    min-height: 0;
}

.column-content::-webkit-scrollbar {
    width: 6px;
}

.column-content::-webkit-scrollbar-track {
    background: #f7fafc;
}

.column-content::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

/* Movie Card */
.movie-card {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 4px;
    cursor: grab;
    transition: all 0.2s ease;
    position: relative;
}

.movie-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #cbd5e0;
}

.movie-card:active {
    cursor: grabbing;
}

.movie-card.dragging {
    z-index: 1000;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.movie-card h3 {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 6px;
    margin-right: 20px;
    line-height: 1.2;
}

.movie-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    color: #718096;
    margin-top: 4px;
}

.movie-info .info-item {
    display: flex;
    align-items: center;
    gap: 2px;
}

.movie-info .icon {
    width: 10px;
    text-align: center;
    font-size: 0.6rem;
}

.phase-number {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #e2e8f0;
    color: #4a5568;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 600;
}

/* Drop Zones */
.drop-zone {
    position: relative;
    min-height: 200px;
}

.drop-zone.drag-over {
    background: #e6fffa;
    border: 2px dashed #38b2ac;
}

/* Drop indicator for reordering within columns */
.drop-indicator {
    height: 3px;
    background: linear-gradient(90deg, #38b2ac, #4fd1c7);
    margin: 8px 12px;
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.15s ease;
    box-shadow: 0 0 8px rgba(56, 178, 172, 0.4);
}

.drop-indicator.show {
    opacity: 1;
    animation: pulse 0.8s ease-in-out infinite alternate;
}

@keyframes pulse {
    from { 
        opacity: 0.8; 
        transform: scaleY(1);
    }
    to { 
        opacity: 1; 
        transform: scaleY(1.2);
    }
}

.empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #a0aec0;
    font-size: 0.875rem;
    text-align: center;
    pointer-events: none;
    font-weight: 500;
}

.ranking-column .movie-card {
    background: white;
    border: 1px solid #e2e8f0;
}

.ranking-column[data-rank="top-tier"] .movie-card {
    border-left: 4px solid #48bb78;
}

.ranking-column[data-rank="very-good"] .movie-card {
    border-left: 4px solid #4299e1;
}

.ranking-column[data-rank="good"] .movie-card {
    border-left: 4px solid #ed8936;
}

.ranking-column[data-rank="neutral"] .movie-card {
    border-left: 4px solid #a0aec0;
}

.ranking-column[data-rank="bad"] .movie-card {
    border-left: 4px solid #f56565;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.movie-card {
    animation: slideIn 0.3s ease;
}

/* Loading state */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: #a0aec0;
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .columns-container {
        grid-template-columns: 260px repeat(5, 1fr);
        gap: 10px;
    }
    
    .column-header {
        padding: 12px 16px;
    }
    
    .column-content {
        padding: 10px;
    }
}

@media (max-width: 1200px) {
    .container {
        min-width: 1000px;
    }
    
    .columns-container {
        grid-template-columns: 240px repeat(5, 1fr);
        gap: 8px;
    }
    
    .movie-card {
        padding: 8px;
        margin-bottom: 6px;
    }
    
    .movie-card h3 {
        font-size: 0.8rem;
    }
    
    .movie-info {
        font-size: 0.7rem;
    }
}

/* Ranking Table Section */
.ranking-table-section {
    margin-top: 24px;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.ranking-table-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 16px;
    text-align: center;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.ranking-table th {
    background: #f7fafc;
    color: #4a5568;
    font-weight: 600;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
}

.ranking-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e2e8f0;
    color: #2d3748;
}

.ranking-table tr:hover {
    background: #f7fafc;
}

.ranking-table .rank-cell {
    width: 60px;
    text-align: center;
    font-weight: 600;
}

.ranking-table .title-cell {
    font-weight: 500;
}

.ranking-table .category-cell {
    font-size: 0.8rem;
    color: #718096;
}

.ranking-table .rating-cell {
    text-align: center;
    font-size: 0.8rem;
}

.empty-ranking {
    text-align: center;
    color: #a0aec0;
    font-style: italic;
    padding: 40px;
}

/* Print styles */
@media print {
    body {
        background: white;
    }
    
    .reset-btn, .recalculate-btn {
        display: none;
    }
    
    .column {
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }
    
    .movie-card {
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }
}

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

.modal-content {
    background-color: white;
    margin: 10% auto;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 0 24px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 24px;
    padding-bottom: 16px;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a202c;
    margin: 0;
}

.close {
    color: #718096;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.close:hover {
    color: #1a202c;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #4a5568;
    font-size: 0.875rem;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.form-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 0 24px 24px 24px;
}

.cancel-btn, .submit-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    border: none;
}

.cancel-btn {
    background: #f7fafc;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.cancel-btn:hover {
    background: #edf2f7;
}

.submit-btn {
    background: #48bb78;
    color: white;
}

.submit-btn:hover {
    background: #38a169;
    transform: translateY(-1px);
}

.submit-btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
} 