:root {
    /* Light Theme (Default) */
    --bg-body-gradient: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    --bg-container: #ffffff;
    --bg-header-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-main: #333333;
    --text-header: #ffffff;
    --text-muted: #6c757d;
    --bg-tab: #f8f9fa;
    --bg-tab-hover: #e9ecef;
    --bg-tab-active: #ffffff;
    --border-color: #e9ecef;
    --accent-color: #667eea;
    --bg-card: #f8f9fa;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --input-bg: #ffffff;
    --input-border: #e0e0e0;
}

[data-theme="dark"] {
    /* Dark Theme */
    --bg-body-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --bg-container: #1e1e1e;
    --bg-header-gradient: linear-gradient(135deg, #312e81 0%, #4338ca 100%);
    --text-main: #e2e8f0;
    --text-header: #f1f5f9;
    --text-muted: #94a3b8;
    --bg-tab: #1e1e1e;
    --bg-tab-hover: #2d2d2d;
    --bg-tab-active: #2d2d2d; /* Make active tab match content bg */
    --border-color: #334155;
    --accent-color: #818cf8;
    --bg-card: #2d2d2d;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --input-bg: #1e1e1e;
    --input-border: #475569;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-body-gradient);
    color: var(--text-main);
    min-height: 100vh;
    padding: 20px;
    transition: background 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-container);
    border-radius: 12px;
    box-shadow: 0 10px 40px var(--shadow-color);
    overflow: hidden;
    transition: background-color 0.3s ease;
}

header {
    background: var(--bg-header-gradient);
    color: var(--text-header);
    padding: 40px 30px;
    text-align: center;
    position: relative;
}

/* Theme Toggle Button */
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.2rem;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.server-ip {
    font-size: 1.5em;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 8px;
    display: inline-block;
    margin-top: 10px;
    font-weight: 600;
}

.tabs {
    display: flex;
    background: var(--bg-tab);
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
    transition: background-color 0.3s ease;
}

.tab-button {
    flex: 1;
    min-width: 150px;
    padding: 18px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.3s ease;
    position: relative;
}

.tab-button:hover {
    background: var(--bg-tab-hover);
    color: var(--accent-color);
}

.tab-button.active {
    color: var(--accent-color);
    background: var(--bg-tab-active);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-color);
}

.tab-button.staff-only {
    color: #dc3545;
}

.tab-button.staff-only:hover {
    background: rgba(220, 53, 69, 0.1);
}

main {
    padding: 40px 30px;
    min-height: 400px;
    background: var(--bg-container);
    transition: background-color 0.3s ease;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h2 {
    color: var(--accent-color);
    margin-bottom: 25px;
    font-size: 2em;
}

h3 {
    color: var(--text-main);
    margin-bottom: 15px;
}

.info-card {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 8px;
    margin-top: 20px;
    border-left: 4px solid var(--accent-color);
    transition: background-color 0.3s ease;
}

.info-card ul {
    margin-left: 20px;
    margin-top: 15px;
}

.info-card li {
    margin: 10px 0;
    font-size: 1.05em;
    color: var(--text-main);
}

.form-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.form-card {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.form-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px var(--shadow-color);
}

.form-card h3 {
    color: var(--accent-color);
    margin-bottom: 15px;
}

.staff-portal {
    max-width: 600px;
    margin: 0 auto;
}

.access-notice {
    background: rgba(220, 53, 69, 0.1);
    border: 2px solid #dc3545;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.1em;
    color: #dc3545;
    font-weight: 600;
}

.portal-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 8px;
    text-align: center;
}

.portal-note {
    color: var(--text-muted);
    font-style: italic;
    margin: 15px 0;
}

footer {
    background: var(--bg-tab);
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.auth-container {
    max-width: 640px;
}

.auth-main {
    padding: 40px 30px;
}

.auth-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px var(--shadow-color);
    text-align: center;
}

.auth-card h2 {
    margin-bottom: 10px;
}

.auth-subtitle {
    color: var(--text-muted);
    margin-bottom: 25px;
}

.auth-form {
    display: grid;
    gap: 18px;
    text-align: left;
}

.form-group {
    display: grid;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-main);
}

.form-group input {
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    background: var(--input-bg);
    color: var(--text-main);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.primary-button {
    background: var(--bg-header-gradient);
    color: white;
    padding: 12px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.05em;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

.primary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px var(--shadow-color);
}

.auth-switch {
    margin-top: 18px;
    color: var(--text-muted);
}

.auth-switch a {
    color: var(--accent-color);
    font-weight: 700;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }
    
    .server-ip {
        font-size: 1.2em;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-button {
        min-width: 100%;
    }
    
    main {
        padding: 20px 15px;
    }
    
    .form-links {
        grid-template-columns: 1fr;
    }
}

/* Staff Applications Page Styles */
.application-paths {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.path-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    border-top: 5px solid var(--accent-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.path-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow-color);
}

.path-card h3 {
    font-size: 1.5em;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.rank-list {
    list-style: none;
    margin-bottom: 25px;
    flex-grow: 1; /* Pushes button to bottom */
}

.rank-list li {
    padding: 8px 0;
    font-size: 1.1em;
    color: var(--text-main);
}

.rank-list li:not(:last-child) {
    border-bottom: 1px dashed var(--border-color);
}

.apply-btn {
    display: inline-block;
    background: var(--bg-header-gradient);
    color: white;
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.warning-card {
    border-left-color: #f0ad4e; /* Orange for warning */
    margin-top: 40px;
}

.intro-text {
    font-size: 1.2em;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    color: var(--text-muted);
}

/* Application Form Styles */
.app-form-container {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 12px;
    margin-top: 30px;
    box-shadow: 0 10px 40px var(--shadow-color);
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.staff-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    color: var(--accent-color);
    margin-bottom: 20px;
    font-size: 1.4em;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    background: var(--input-bg);
    color: var(--text-main);
    font-family: inherit;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    background: var(--input-bg);
    color: var(--text-main);
    cursor: pointer;
}

input[type="file"] {
    background: var(--bg-tab);
    padding: 10px;
    border-radius: 8px;
    border: 1px dashed var(--border-color);
    width: 100%;
    cursor: pointer;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.scenario-text {
    background: rgba(102, 126, 234, 0.1);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
    margin-bottom: 10px;
    font-style: italic;
    color: var(--text-main);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--text-muted);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .app-form-container {
        padding: 20px;
    }
}
