/* Aurora Theme - Modern Light/Dark Theme */

/* CSS Custom Properties for Theme Colors */
:root[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-tertiary: #adb5bd;
    --accent-primary: #4f46e5;
    --accent-secondary: #6366f1;
    --accent-hover: #4338ca;
    --border-color: #dee2e6;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --card-bg: #ffffff;
    --input-bg: #ffffff;
    --input-border: #ced4da;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
}

:root[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --accent-primary: #6366f1;
    --accent-secondary: #818cf8;
    --accent-hover: #4f46e5;
    --border-color: #334155;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);
    --card-bg: #1e293b;
    --input-bg: #334155;
    --input-border: #475569;
    --success: #34d399;
    --error: #f87171;
    --warning: #fbbf24;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.site-header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background-color: rgba(var(--bg-secondary-rgb), 0.95);
}

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

.site-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    width: 2.5rem;
    height: 2.5rem;
}

.theme-toggle:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.theme-toggle:hover svg {
    color: white;
}

.theme-toggle svg {
    color: var(--text-primary);
    transition: color 0.2s ease;
}

:root[data-theme="light"] .moon-icon {
    display: none;
}

:root[data-theme="dark"] .sun-icon {
    display: none;
}

/* Main Content */
.site-main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
}

.main-content {
    background: var(--card-bg);
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-card {
    background: var(--card-bg);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--input-border);
    border-radius: 0.5rem;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-control::placeholder {
    color: var(--text-tertiary);
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.checkbox-group input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-block {
    width: 100%;
}

.button {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

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

input[type="submit"] {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

input[type="submit"]:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

table td,
table th {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table th {
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

table tr:hover {
    background: var(--bg-secondary);
}

/* User Card */
.user-name {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Footer */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-links a {
    color: var(--text-secondary);
    margin-left: 1rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--accent-primary);
}

/* Page Specific Styles */
#page_title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.padder {
    padding: 1rem;
}

.smalltext {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Admin Styles */
#admin_title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 1rem 0;
    color: var(--text-primary);
}

hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}

/* Tooltip */
#dhtmltooltip {
    position: absolute;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    box-shadow: var(--shadow-lg);
    font-size: 0.85rem;
    color: var(--text-primary);
    z-index: 1000;
}

/* Responsive Design */
@media (max-width: 968px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    .site-title {
        font-size: 1.5rem;
    }

    .main-content {
        padding: 1.5rem;
    }

    .sidebar-card {
        padding: 1rem;
    }

    #page_title {
        font-size: 1.5rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links a {
        margin-left: 0;
        margin-right: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }

    .site-header {
        padding: 0.75rem 0;
    }

    .site-title {
        font-size: 1.25rem;
    }

    .main-content {
        padding: 1rem;
        border-radius: 0.5rem;
    }

    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* Help Section Styling */
.help-section {
    margin-bottom: 2em;
    padding: 1.5em;
    background: var(--bg-secondary);
    border-radius: 8px;
    line-height: 1.6;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.help-section h1 {
    color: var(--text-primary);
    font-size: 2em;
    margin-top: 0;
    margin-bottom: 0.5em;
    padding-bottom: 0.3em;
    border-bottom: 3px solid var(--accent-primary);
}

.help-section h2 {
    color: var(--text-primary);
    font-size: 1.5em;
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    padding-left: 0.5em;
    border-left: 4px solid var(--accent-primary);
}

.help-section h3 {
    color: var(--text-secondary);
    font-size: 1.2em;
    margin-top: 1.2em;
    margin-bottom: 0.6em;
}

.help-section p {
    margin: 0.8em 0;
    color: var(--text-primary);
}

.help-section ul, .help-section ol {
    margin: 1em 0;
    padding-left: 2em;
}

.help-section li {
    margin: 0.5em 0;
    color: var(--text-primary);
}

.help-section code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    color: var(--error);
    border: 1px solid var(--border-color);
}

.help-section pre {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 1em;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1em 0;
    border-left: 4px solid var(--accent-primary);
    border: 1px solid var(--border-color);
}

.help-section pre code {
    background: none;
    border: none;
    color: inherit;
    padding: 0;
}

.help-section blockquote {
    background: var(--bg-tertiary);
    border-left: 4px solid var(--warning);
    margin: 1em 0;
    padding: 0.8em 1.2em;
    font-style: italic;
    color: var(--text-secondary);
    border-radius: 4px;
}

.help-section blockquote p {
    margin: 0.3em 0;
}

.help-section strong {
    color: var(--text-primary);
    font-weight: 600;
}

.help-section a {
    color: var(--accent-secondary);
    text-decoration: none;
    border-bottom: 1px dotted var(--accent-secondary);
}

.help-section a:hover {
    color: var(--accent-hover);
    border-bottom-style: solid;
}

.help-section hr {
    border: none;
    border-top: 2px solid var(--border-color);
    margin: 2em 0;
}

.help-divider {
    border: none;
    border-top: 1px dashed var(--border-color);
    margin: 2.5em 0;
}

.help-section ul li::marker {
    color: var(--success);
}

.help-section table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    border: 1px solid var(--border-color);
}

.help-section table th {
    background: var(--accent-primary);
    color: white;
    padding: 0.8em;
    text-align: left;
    font-weight: 600;
}

.help-section table td {
    padding: 0.8em;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.help-section table tr:hover {
    background: var(--bg-tertiary);
}

.help-notice {
    background: var(--bg-tertiary);
    border: 1px solid var(--warning);
    border-radius: 5px;
    padding: 1em 1.5em;
    margin: 1em 0;
    color: var(--text-primary);
}

.help-legacy {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 1.5em;
    margin: 1em 0;
    font-family: monospace;
    white-space: pre-wrap;
    color: var(--text-primary);
}

/* Print Styles */
@media print {
    .site-header,
    .main-nav,
    .sidebar,
    .site-footer,
    .theme-toggle,
    .mobile-menu-toggle {
        display: none;
    }

    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .help-section {
        background: white;
        border: none;
        page-break-inside: avoid;
    }

    .help-section pre {
        background: #f5f5f5;
        color: #000;
        border: 1px solid #ddd;
    }
}
