@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css');

:root {
    --primary-color: #2C5E38;
    --secondary-color: #FFFFFF;
    --accent-color: #FFD700;
    --text-color: #333333;
    --light-bg: #F8F9FA;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    position: relative;
    background-color: var(--primary-color);
    color: var(--secondary-color);
    padding: 1rem 0;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo img {
    height: 50px;
    margin-right: 1rem;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--secondary-color);
    font-size: 1.5rem;
    cursor: pointer;
}

.logout-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.3);
    margin-left: 20px;
}

.logout-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(231, 76, 60, 0.4);
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
}

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

nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

nav ul li {
    margin-left: 2rem;
}

nav a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

nav a:hover, nav a.active {
    color: var(--accent-color);
}

main {
    flex: 1;
}

.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #4CAF50 100%);
    color: var(--secondary-color);
    padding: 4rem 2rem 1rem 2rem;
    text-align: center;
    background-image: url('https://via.placeholder.com/1920x600/2C5E38/FFFFFF?text=Tennis+Academy');
    background-size: cover;
    background-position: center;
}

.hero h1 {
    color: black;
}

.hero p {
    color: black;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem 2rem 2rem;
}

.card {
    background: var(--secondary-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
    max-width: 100%;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.wide-card {
    max-width: 100%;
}

.section-description {
    color: #475569;
    margin: 0.5rem 0 1.5rem;
    line-height: 1.5;
}

.section-subtitle {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1rem;
}

.player-form .form-group {
    display: flex;
    flex-direction: column;
}

.player-form .form-group label {
    margin-bottom: 0.5rem;
    color: #0f172a;
    font-size: 0.95rem;
}

.player-form input,
.player-form select,
.player-form textarea {
    border: 1px solid #cbd5e1;
    background: #ffffff;
}

.player-form input::placeholder {
    color: #94a3b8;
}

.lesson-row {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.lesson-row .form-group {
    margin-bottom: 0;
}

.lesson-row .icon-button {
    margin-top: 1rem;
}

.player-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.player-card-header h4 {
    margin-bottom: 0.5rem;
}

.player-card p {
    margin: 0.2rem 0;
    color: #475569;
}

.player-allocation-list {
    margin-top: 0.75rem;
    display: grid;
    gap: 0.6rem;
}

.player-allocation-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.7rem 0.85rem;
    background: #f8fafc;
    border: 1px solid #dbe5dd;
    border-radius: 10px;
}

.player-form #player-slot {
    min-height: 180px;
}

.player-lesson-row {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.player-lesson-grid {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
}

.player-slot-row {
    min-height: 48px;
}

.player-slot-row-hint {
    margin-top: 0.35rem;
}

.icon-button,
.secondary-button {
    background: #f1f5f9;
    color: var(--text-color);
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.icon-button:hover,
.secondary-button:hover {
    background: #e2e8f0;
}

.players-grid {
    display: grid;
    gap: 1rem;
}

.player-card-header,
.lesson-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.player-card-header {
    margin-bottom: 1rem;
}

.player-card-header > div {
    flex: 1;
}

.form-grid,
.lesson-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 1024px) {
    .form-grid,
    .lesson-grid {
        grid-template-columns: 1fr;
    }

    .player-lesson-grid {
        grid-template-columns: 1fr;
    }

    .player-form .form-full {
        grid-column: span 1;
    }
}

.player-form .form-full {
    grid-column: span 2;
}

.lesson-allocation {
    margin-top: 1.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.lesson-list .lesson-row {
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: #ffffff;
}

.coach-availability {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: #eef2ff;
    border-radius: 8px;
    color: #1e293b;
    font-size: 0.95rem;
}

.coach-availability strong {
    color: #0f172a;
}

.lesson-summary {
    margin-top: 1rem;
    display: grid;
    gap: 0.75rem;
}

.lesson-summary-row,
.player-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.player-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.players-grid {
    display: grid;
    gap: 1rem;
}

.icon-button,
.secondary-button {
    background: #f1f5f9;
    color: var(--text-color);
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.secondary-button:hover,
.icon-button:hover {
    background: #e2e8f0;
}

.primary-button {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}

.status-message {
    margin-top: 1rem;
    font-weight: 500;
}

.status-message.success {
    color: #065f46;
}

.status-message.error {
    color: #b91c1c;
}

.coach-list {
    display: grid;
    gap: 1rem;
}

.coach-form,
.coach-schedule-form {
    margin-top: 1rem;
}

.coach-form-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.coach-card {
    border: 1px solid #dbe5dd;
    border-radius: 12px;
    background: #ffffff;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(25, 50, 30, 0.08);
}

.coach-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.coach-card-header h4 {
    color: var(--primary-color);
}

.coach-schedule-dashboard {
    padding-top: 1.5rem;
}

.coach-password-panel {
    max-width: 640px;
    margin: 0 auto;
    padding: 2rem;
}

.coach-password-form {
    display: grid;
    gap: 0.85rem;
    margin-top: 1rem;
}

.coach-password-form label {
    font-weight: 700;
    color: var(--primary-color);
}

.coach-password-form input {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 0.8rem 0.9rem;
    font-size: 1rem;
}

.coach-password-form button {
    justify-self: start;
}

.coach-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.schedule-filter-group {
    display: flex;
    flex-direction: column;
    min-width: 220px;
    gap: 0.35rem;
}

.coach-schedule-groups {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.coach-day-group {
    border: 1px solid #dbe5dd;
    border-radius: 14px;
    background: #ffffff;
    padding: 1rem;
}

.coach-day-group.is-today {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.2);
}

.coach-day-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.coach-day-group-header h3 {
    color: var(--primary-color);
}

.coach-day-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: #eef5f0;
    color: #1f4a2a;
    font-weight: 700;
}

.coach-lesson-list {
    display: grid;
    gap: 0.85rem;
}

.coach-lesson-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    background: #f8fafc;
}

.coach-lesson-card.is-today {
    background: linear-gradient(180deg, #fffbea 0%, #f8fafc 100%);
}

.coach-lesson-topline {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.coach-lesson-topline h4 {
    color: #0f172a;
    margin-bottom: 0.2rem;
}

.coach-lesson-topline p {
    color: #475569;
}

.coach-lesson-capacity {
    font-weight: 700;
    color: #176437;
    background: #e8f5ec;
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
}

.coach-lesson-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    color: #475569;
    margin-bottom: 0.85rem;
}

.coach-lesson-players strong {
    display: block;
    margin-bottom: 0.45rem;
    color: #1f2937;
}

.coach-lesson-players ul {
    margin: 0;
    padding-left: 1.1rem;
    color: #334155;
}

.coach-day-empty {
    text-align: center;
}

.coach-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.coach-schedule-block {
    margin-bottom: 1rem;
}

.coach-schedule-block h5 {
    color: #1f4a2a;
    margin-bottom: 0.5rem;
}

.coach-schedule-table-wrap {
    overflow-x: auto;
}

.coach-schedule-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
}

.coach-schedule-table th,
.coach-schedule-table td {
    border: 1px solid #d7e1da;
    padding: 0.55rem;
    text-align: left;
    vertical-align: middle;
}

.coach-schedule-table th {
    background: #ecf4ee;
    color: #1f4a2a;
    font-weight: 700;
}

.schedule-actions {
    display: flex;
    gap: 0.5rem;
}

.schedule-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 0.85rem;
    font-weight: 700;
}

.schedule-badge.open {
    background: #e8f5ec;
    color: #176437;
}

.schedule-badge.full {
    background: #fee2e2;
    color: #991b1b;
}

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
    align-items: end;
}

.schedule-span-2 {
    grid-column: span 2;
}

.schedule-span-full {
    grid-column: 1 / -1;
}

.schedule-start-group,
.schedule-end-group,
.schedule-total-group,
.schedule-available-group {
    grid-row: 2;
    justify-self: start;
    width: 100%;
    max-width: 220px;
}

.schedule-start-group {
    grid-column: 1;
}

.schedule-end-group {
    grid-column: 2;
}

.schedule-total-group {
    grid-column: 3;
}

.schedule-available-group {
    grid-column: 4;
}

.coach-schedule-form .schedule-start-group input,
.coach-schedule-form .schedule-end-group input {
    max-width: 180px;
}

.coach-schedule-form .schedule-total-group input,
.coach-schedule-form .schedule-available-group input {
    max-width: 140px;
}

.coach-schedule-form .form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

@media (max-width: 1100px) {
    .schedule-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .schedule-span-2 {
        grid-column: span 2;
    }

    .schedule-span-full {
        grid-column: 1 / -1;
    }

    .schedule-start-group,
    .schedule-end-group,
    .schedule-total-group,
    .schedule-available-group {
        grid-row: auto;
        grid-column: span 1;
    }
}

.coach-form input,
.coach-form select,
.coach-schedule-form input,
.coach-schedule-form select {
    border-radius: 10px;
    border: 1px solid #ced9d0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.coach-form input:hover,
.coach-form select:hover,
.coach-schedule-form input:hover,
.coach-schedule-form select:hover {
    border-color: #89a896;
}

.coach-form input:focus,
.coach-form select:focus,
.coach-schedule-form input:focus,
.coach-schedule-form select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 94, 56, 0.16);
}

.coach-form input:disabled {
    background: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .player-form .form-grid,
    .lesson-grid {
        grid-template-columns: 1fr;
    }

    .schedule-grid {
        grid-template-columns: 1fr;
    }

    .schedule-span-2 {
        grid-column: span 1;
    }

    .schedule-span-full {
        grid-column: span 1;
    }

    .schedule-start-group,
    .schedule-end-group,
    .schedule-total-group,
    .schedule-available-group {
        grid-row: auto;
        grid-column: span 1;
    }

    .coach-card-actions,
    .coach-form-actions {
        width: 100%;
    }

    .coach-dashboard-header {
        align-items: stretch;
    }

    .schedule-filter-group {
        width: 100%;
    }

    .coach-card-actions button,
    .coach-form-actions button {
        width: 100%;
    }

    .player-form .form-full {
        grid-column: span 1;
    }

    .card {
        max-width: 100%;
    }
}

.tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 2rem;
}

.tab-button {
    background: none;
    border: none;
    padding: 1rem 2rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-button:hover,
.tab-button:focus {
    color: var(--secondary-color);
    background: var(--primary-color);
}

.tab-button.active {
    color: var(--secondary-color);
    background: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

label {
    font-weight: 500;
}

input, select, textarea {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

button {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #1F4A2A;
}

footer {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    padding: 2rem 0;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.footer-info {
    flex: 1;
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icons a {
    color: var(--secondary-color);
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

.social-icons a:hover {
    color: var(--accent-color);
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        padding: 0 1rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .logo img {
        height: 40px;
    }

    .menu-toggle {
        display: block;
        position: absolute;
        top: 1rem;
        right: 1rem;
        background: rgba(255,255,255,0.1);
        border: none;
        color: var(--secondary-color);
        width: 44px;
        height: 44px;
        border-radius: 8px;
        cursor: pointer;
    }

    .menu-toggle:hover {
        background: rgba(255,255,255,0.2);
    }

    nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--primary-color);
        padding: 1rem 0;
        box-shadow: var(--shadow);
        z-index: 1000;
    }

    nav ul.show {
        display: flex !important;
    }

    nav ul li {
        margin: 0.5rem 0;
        text-align: center;
    }

    .hero {
        padding: 2rem 1rem 1rem 1rem;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .container {
        padding: 1rem;
    }

    .card {
        padding: 1rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
    }

    .tabs {
        flex-direction: column;
    }

    .tab-button {
        border-bottom: none;
        border-left: 3px solid transparent;
    }

    .tab-button.active {
        border-left-color: var(--primary-color);
        border-bottom-color: transparent;
    }
}