/* ========== RESET & BASE (NETFLIX THEME) ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #141414;
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
}

.screen {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ========== LOGIN SCREEN ========== */
#loginScreen {
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), 
                url('https://images.unsplash.com/photo-1574629810360-7efbbe195018?w=1920') center/cover;
}

.login-container {
    background: rgba(0, 0, 0, 0.85);
    border-radius: 12px;
    padding: 60px 50px;
    width: 100%;
    max-width: 450px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8);
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h1 {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #e50914 0%, #ff6b6b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95em;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
}

.login-footer a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.3s;
}

.login-footer a:hover {
    color: #e50914;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9em;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.form-group input,
.form-group select,
.form-group textarea {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 12px 16px;
    color: #fff;
    font-size: 15px;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
    border-color: #e50914;
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.1);
}

.form-group small {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.5);
}

.error-message {
    background: rgba(229, 9, 20, 0.2);
    border: 1px solid #e50914;
    color: #ff6b6b;
    padding: 12px;
    border-radius: 6px;
    font-size: 0.9em;
    text-align: center;
}

/* ========== BUTTONS ========== */
.btn {
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #e50914 0%, #b20710 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(229, 9, 20, 0.5);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-ghost {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-danger {
    background: rgba(229, 9, 20, 0.2);
    color: #ff6b6b;
    border: 1px solid #e50914;
}

.btn-danger:hover {
    background: rgba(229, 9, 20, 0.3);
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85em;
}

.btn-loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== DASHBOARD SCREEN ========== */
#dashboardScreen {
    display: block;
    padding: 0;
}

.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-left h1 {
    font-size: 2em;
    font-weight: 700;
    background: linear-gradient(135deg, #e50914 0%, #ff6b6b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.status-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.status-badge.online {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid #4caf50;
}

.header-right {
    display: flex;
    gap: 15px;
}

/* ========== MATCHES LIST ========== */
.matches-list {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.matches-list h2 {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #fff;
}

.matches-table {
    width: 100%;
    border-collapse: collapse;
}

.matches-table th,
.matches-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.matches-table th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.matches-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.match-teams {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.match-badge {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
}

.match-badge.live {
    background: rgba(229, 9, 20, 0.2);
    color: #e50914;
    border: 1px solid #e50914;
}

.match-badge.upcoming {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid #4caf50;
}

.match-badge.ended {
    background: rgba(158, 158, 158, 0.2);
    color: #9e9e9e;
    border: 1px solid #9e9e9e;
}

.match-actions {
    display: flex;
    gap: 8px;
}

/* ========== LINK INDICATOR ========== */
.link-indicator {
    display: inline-flex;
    gap: 5px;
}

.link-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.link-dot.active {
    background: #4caf50;
    box-shadow: 0 0 10px #4caf50;
}

/* ========== MODAL ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.modal-content {
    background: #1f1f1f;
    border-radius: 12px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    font-size: 1.5em;
    font-weight: 700;
    color: #fff;
}

.modal-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 2em;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.match-form {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.stream-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
}

.stream-section h3 {
    font-size: 1.1em;
    margin-bottom: 15px;
    color: #e50914;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========== TOAST NOTIFICATION ========== */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2000;
    max-width: 400px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: #4caf50;
    color: white;
}

.toast.error {
    background: #e50914;
    color: white;
}

.toast.info {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.5);
}

.empty-state h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.7);
}

/* ========== SCROLLBAR (NETFLIX STYLE) ========== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #141414;
}

::-webkit-scrollbar-thumb {
    background: #e50914;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff0a16;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .matches-table {
        font-size: 0.9em;
    }
    
    .matches-table th,
    .matches-table td {
        padding: 12px;
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }

    .header-right {
        width: 100%;
        flex-direction: column;
    }

    .header-right button {
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-content {
        max-width: 100%;
    }

    .matches-table {
        display: block;
        overflow-x: auto;
    }

    .login-container {
        padding: 40px 30px;
    }

    .toast {
        left: 20px;
        right: 20px;
        bottom: 20px;
    }
}

@media (max-width: 480px) {
    .dashboard-container {
        padding: 15px;
    }

    .matches-list {
        padding: 20px 15px;
    }

    .match-form {
        padding: 20px 15px;
    }

    .modal-header {
        padding: 20px 15px;
    }
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-container > * {
    animation: fadeIn 0.6s ease-out;
}