/* Inter Font - Self-hosted */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/Inter-Regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/fonts/Inter-Medium.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/Inter-SemiBold.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/Inter-Bold.woff2') format('woff2');
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Page-specific body styles */
body.page-table {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

body.page-form-small {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

body.page-form-large {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Main content wrapper */
.main-content {
    padding-top: 80px;
}

/* Typography */
h1 {
    color: #333;
    margin-bottom: 10px;
}

h2 {
    color: #333;
    font-size: 20px;
    margin-bottom: 15px;
    border-bottom: 2px solid #4caf50;
    padding-bottom: 5px;
}

/* Layout */
.container {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    max-width: 800px;
    margin: 50px auto;
}

.section {
    margin: 30px 0;
}

.section h2 {
    color: #333;
    font-size: 20px;
    margin-bottom: 15px;
    border-bottom: 2px solid #4caf50;
    padding-bottom: 5px;
}

.section p {
    color: #666;
    margin-bottom: 15px;
}

/* Top Navigation Bar */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    height: 60px;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Brand/Logo */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
}

.nav-brand .logo {
    font-size: 28px;
    line-height: 1;
}

.nav-brand .brand-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.nav-brand:hover {
    opacity: 0.9;
}

/* Main Navigation Links */
.nav-links {
    display: flex;
    gap: 0;
    align-items: center;
    margin-left: 40px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 20px 20px;
    font-size: 15px;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-bottom-color: rgba(255, 255, 255, 0.5);
}

.nav-links a.active {
    border-bottom-color: white;
    background-color: rgba(255, 255, 255, 0.15);
}

/* Right Side Actions */
.nav-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-left: auto;
}

.nav-actions a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 10px 18px;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-actions a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.nav-actions a.primary {
    background-color: white;
    color: #4caf50;
    border-color: white;
    font-weight: 600;
}

.nav-actions a.primary:hover {
    background-color: #f0f0f0;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Forms */
label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: bold;
}

input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

input[type="text"]:focus {
    outline: none;
    border-color: #4caf50;
}

button,
.button {
    padding: 12px;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

button:hover,
.button:hover {
    background-color: #45a049;
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

button[type="submit"] {
    width: 100%;
    margin-top: 20px;
}

/* Tables */
table {
    border-collapse: collapse;
    width: 100%;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

th,
td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

th {
    background-color: #4caf50;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    border-bottom: none;
}

tbody tr {
    transition: background-color 0.2s;
}

tbody tr:hover {
    background-color: #f5f5f5;
}

tbody tr:last-child td {
    border-bottom: none;
}

td {
    color: #333;
}

td a {
    color: #4caf50;
    text-decoration: none;
    font-weight: 500;
}

td a:hover {
    text-decoration: underline;
    color: #45a049;
}

/* Center align status badges in tables */
td .tournament-status {
    display: inline-block;
}

/* Table container */
.table-container {
    margin-top: 20px;
    overflow-x: auto;
}

/* Links */
.back-link {
    display: inline-block;
    margin-top: 20px;
    color: #4caf50;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

/* Description Text */
.description {
    color: #666;
    margin-bottom: 30px;
    line-height: 1.5;
}

/* Instructions */
.instructions {
    margin: 20px 0;
    line-height: 1.6;
    color: #666;
}

.instructions ul {
    margin: 10px 0;
    padding-left: 20px;
}

.instructions li {
    margin: 8px 0;
}

/* Info Box */
.info-box {
    background-color: #e7f3ff;
    border-left: 4px solid #2196f3;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.info-box p {
    margin: 5px 0;
    color: #333;
}

/* Warning Box */
.warning {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 15px;
    margin: 20px 0;
    color: #856404;
}

.warning strong {
    display: block;
    margin-bottom: 5px;
    font-size: 18px;
}

/* Success Icon */
.success-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 20px;
}

h1.success {
    color: #4caf50;
}

/* ID Container */
.id-container {
    background-color: #f8f9fa;
    border: 2px solid #4caf50;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.id-label {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.id-code {
    font-family: "Courier New", monospace;
    font-size: 24px;
    color: #333;
    font-weight: bold;
    word-break: break-all;
    user-select: all;
}

/* ID Input Form */
.id-input-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 30px 0;
}

.id-input {
    width: 80px;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 20px;
    font-family: "Courier New", monospace;
    text-align: center;
    text-transform: lowercase;
    font-weight: bold;
    letter-spacing: 2px;
}

.id-input:focus {
    outline: none;
    border-color: #4caf50;
}

.separator {
    font-size: 24px;
    color: #999;
    font-weight: bold;
}

/* Action Buttons */
.action-buttons {
    margin-top: 30px;
    display: flex;
    gap: 10px;
}

.action-buttons button,
.action-buttons .button {
    flex: 1;
    margin: 0;
    width: auto;
}

.action-buttons button:only-child {
    width: 100%;
}

.copy-button {
    background-color: #4caf50;
    color: white;
}

.copy-button:hover {
    background-color: #45a049;
}

.home-button,
.cancel-button,
a.button {
    background-color: #6c757d;
    color: white;
}

.home-button:hover,
.cancel-button:hover,
a.button:hover {
    background-color: #5a6268;
}

/* Error Message */
.error-message {
    color: #dc3545;
    margin-top: 10px;
    font-size: 14px;
    display: none;
}

/* Calendar URL Box */
.calendar-url-box {
    background-color: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.calendar-url-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.calendar-url-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.calendar-url-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #b3d9ff;
    border-radius: 4px;
    background-color: white;
    font-family: monospace;
    font-size: 14px;
}

.calendar-url-info {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
}

.copy-link-button {
    padding: 10px 20px;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
}

/* Checkboxes */
.checkbox-group {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    background-color: #fafafa;
}

.checkbox-item {
    margin: 10px 0;
    padding: 12px 16px;
    background-color: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.checkbox-item:hover {
    border-color: #4caf50;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.checkbox-item label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
    justify-content: space-between;
    gap: 15px;
}

.checkbox-item input[type="checkbox"] {
    margin-right: 12px;
    margin-top: 0;
    cursor: pointer;
    width: 20px;
    height: 20px;
    accent-color: #4caf50;
    flex-shrink: 0;
}

.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
}

/* Tournament Info */
.tournament-info {
    flex: 1;
    min-width: 0;
}

.tournament-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 6px;
    font-size: 16px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tournament-link {
    color: #4caf50;
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.tournament-link:hover {
    background-color: #e8f5e9;
    text-decoration: underline;
}

.external-links a {
    display: block;
    margin-bottom: 10px;
}

.external-links a:last-child {
    margin-bottom: 0;
}

.tournament-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.tournament-location {
    font-size: 13px;
    color: #7f8c8d;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tournament-location::before {
    content: "📍";
    font-size: 14px;
}

/* Tournament Status */
.tournament-status {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.status-announced {
    background-color: #d1ecf1;
    color: #0c5460;
}

.status-registration {
    background-color: #fff3cd;
    color: #856404;
}

.status-in-progress,
.status-in-progess {
    background-color: #d4edda;
    color: #155724;
}

.status-done {
    background-color: #e2e3e5;
    color: #383d41;
}

.status-cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

.status-provisional {
    background-color: #fff3cd;
    color: #856404;
}

/* Series */
.tournament-series {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.series-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 4px;
    background-color: #e9ecef;
    color: #495057;
}

.series-tag {
    display: inline-block;
    background-color: #e9ecef;
    padding: 6px 12px;
    margin: 5px;
    border-radius: 4px;
    font-size: 14px;
}

.series-tag button {
    margin-left: 8px;
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-weight: bold;
}

.series-input-group {
    margin-bottom: 15px;
}

.series-input-group input,
.series-input-group select {
    margin-bottom: 10px;
}

.add-series-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.add-series-btn:hover {
    background-color: #5a6268;
}

select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

/* Tournament Dates */
.tournament-dates {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.date-badge {
    background: #f8f9fa;
    color: #495057;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    text-align: center;
    min-width: 70px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.date-weekday {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
}

.date-weekday.sunday {
    color: #dc3545;
}

.date-day {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    color: #2c3e50;
}

.date-month {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
}

.date-separator {
    color: #adb5bd;
    font-size: 20px;
    font-weight: 300;
}

/* Filter Box */
.filter-box {
    margin-bottom: 15px;
    padding: 10px;
    background-color: white;
    border-radius: 4px;
}

.filter-box input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Tournament Details */
.detail-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.detail-card {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.detail-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.detail-card h3 {
    margin: 0 0 12px 0;
    color: #666;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.detail-card .value {
    font-size: 20px;
    color: #2c3e50;
    font-weight: 600;
}

.detail-card .subvalue {
    font-size: 14px;
    color: #666;
    margin-top: 8px;
}

.registration-phases {
    margin: 30px 0;
}

.phase-card {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.phase-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.phase-card h4 {
    margin: 0 0 15px 0;
    color: #4caf50;
    font-size: 16px;
}

.phase-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.phase-info-item {
    display: flex;
    flex-direction: column;
}

.phase-info-item label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    font-weight: 600;
}

.phase-info-item .value {
    font-size: 16px;
    color: #333;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    body.page-table,
    body.page-form-small,
    body.page-form-large {
        padding: 10px;
    }

    .main-content {
        padding-top: 60px;
    }

    .container {
        padding: 20px 15px;
    }

    .nav-container {
        padding: 0 15px;
    }

    .nav-brand .brand-text {
        font-size: 16px;
    }

    .nav-brand .logo {
        font-size: 24px;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
        flex-direction: column;
        gap: 0;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        margin-left: 0;
    }

    .nav-links.mobile-open {
        display: flex;
    }

    .nav-links a {
        width: 100%;
        padding: 15px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-actions {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
        flex-direction: column;
        gap: 0;
        padding: 10px;
        margin-left: 0;
    }

    .nav-actions.mobile-open {
        display: flex;
    }

    .nav-actions a {
        width: 100%;
        justify-content: center;
        margin-bottom: 8px;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .id-input-container {
        flex-wrap: wrap;
    }

    .tournament-dates {
        flex-direction: column;
        align-items: flex-start;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons button,
    .action-buttons .button {
        width: 100%;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
    }

    th, td {
        padding: 8px 10px;
        font-size: 14px;
    }
}
