:root {
    --primary-blue: #0056b3;
    --secondary-blue: #007bff;
    --accent-color: #e3f2fd;
    --white: #ffffff;
    --text-dark: #333333;
    --text-light: #666666;
    --border-color: #dee2e6;
    --success: #28a745;
    --danger: #dc3545;
    --page-bg: #f0f2f5;
    --card-shadow: rgba(0, 0, 0, 0.05);
    --footer-bg: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

[data-theme="dark"] {
    --primary-blue: #3d8bfd;
    --secondary-blue: #0d6efd;
    --accent-color: #1a1d20;
    --white: #1e1e1e;
    --text-dark: #e0e0e0;
    --text-light: #b0b0b0;
    --border-color: #444;
    --page-bg: #121212;
    --card-shadow: rgba(0, 0, 0, 0.4);
    --footer-bg: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--page-bg);
    color: var(--text-dark);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: var(--primary-blue);
}

a:hover {
    text-decoration: underline;
}

/* Header */
header {
    background-color: var(--white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: var(--text-dark);
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--secondary-blue);
}

.user-actions .btn {
    margin-left: 10px;
}

/* Language Switcher */
.lang-switcher {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin-left: 15px;
    padding-left: 15px;
    border-left: 1px solid var(--border-color);
}

.btn-lang {
    background: none;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.btn-lang:hover {
    opacity: 1;
    border-color: var(--primary-blue);
    transform: translateY(-1px);
}

.btn-lang img {
    width: 20px;
    height: auto;
    border-radius: 2px;
}

/* Hide Google Translate UI */
.goog-te-banner-frame.skiptranslate,
.goog-te-banner-frame,
.goog-te-gadget-icon,
.goog-te-gadget-simple span,
#goog-gt-tt,
.goog-tooltip,
.goog-tooltip:hover {
    display: none !important;
}

.goog-te-gadget-simple {
    background-color: transparent !important;
    border: none !important;
}

body {
    top: 0 !important;
}

.goog-text-highlight {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Fix for the white space at the top caused by Translate */
iframe.skiptranslate {
    display: none !important;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

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

.btn-primary:hover {
    background-color: var(--secondary-blue);
    text-decoration: none;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary-blue);
    color: var(--primary-blue);
}

.btn-outline:hover {
    background-color: var(--primary-blue);
    color: var(--white);
    text-decoration: none;
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    animation: fadeIn 0.5s ease-in-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Category List */
.category-card {
    background: var(--white);
    border-radius: 8px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 5px var(--card-shadow);
    margin-bottom: 1rem;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--primary-blue);
    transition: transform 0.2s, box-shadow 0.2s;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.category-info h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.category-info h2 a {
    color: var(--text-dark);
    transition: color 0.2s;
}

.category-info h2 a:hover {
    color: var(--primary-blue);
    text-decoration: none;
}

.category-info p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Forms */
.form-container {
    max-width: 500px;
    margin: 3rem auto;
    background: var(--white);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    /* Deeper shadow */
    animation: slideUp 0.5s ease-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    border-color: var(--secondary-blue);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    outline: none;
}

/* Footer */
footer {
    background: var(--footer-bg);
    /* Deep aviation blue gradient */
    color: var(--white);
    padding: 3rem 0;
    margin-top: 4rem;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    text-align: center;
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* Tiered Category Layout */
/* .category-container wrapper */

/* Top Box */
/* Top Box */
.category-main-box {
    background: var(--white);
    border-radius: 20px;
    /* Highly rounded as per sketch */
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--primary-blue);
    /* Solid blue border as per sketch */
    position: relative;
    z-index: 2;
    /* Sit on top */
}

.category-main-box .category-info h2 {
    font-size: 1.3rem;
    /* Larger font */
    margin-bottom: 5px;
}

.category-main-box .category-stats {
    text-align: right;
    font-size: 0.9rem;
    color: var(--text-light);
    border-left: 1px solid #eee;
    padding-left: 1rem;
    margin-left: 1rem;
}

/* Bottom Box */
.category-sub-topics {
    width: 95%;
    /* Narrower width */
    margin: -15px auto 0 auto;
    /* Negative margin to pull it up/connect, auto for center */
    padding: 2rem 1.5rem 1rem 1.5rem;
    /* Extra top padding to account for overlap */
    /* Extra top padding to account for overlap */
    background: var(--white);
    border: 1px solid var(--primary-blue);
    /* Solid blue border */
    border-top: none;
    /* Looks connected if touching, or keep border if detached. Sketch shows detour. Let's keep border for now. */
    border-radius: 0 0 20px 20px;
    /* Rounded bottom corners */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    position: relative;
    z-index: 1;
    /* Sit behind */
}

/* Adjust the sub-list style for this look */
.sub-topic-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sub-topic-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed #dee2e6;
    /* Dashed for softer look inside */
}

.sub-topic-list li:last-child {
    border-bottom: none;
}

.sub-topic-list a {
    color: var(--text-dark);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s;
}

.sub-topic-list a:hover {
    color: var(--primary-blue);
    text-decoration: none;
}

.sub-topic-list i {
    color: var(--text-light);
    /* Icon color */
    font-size: 0.8rem;
}

.sub-topic-date {
    font-size: 0.8rem;
    color: #888;
    white-space: nowrap;
    margin-left: 10px;
}

.no-sub-topics {
    font-size: 0.85rem;
    color: #adb5bd;
    font-style: italic;
}

/* Editor Toolbar */
/* Editor Toolbar */
.editor-toolbar {
    background: var(--accent-color);
    border: 1px solid #ced4da;
    border-bottom: none;
    padding: 0.5rem;
    border-radius: 4px 4px 0 0;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.editor-toolbar button {
    background: var(--white);
    border: 1px solid #ced4da;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 0.9rem;
    color: #495057;
    min-width: 30px;
}

.editor-toolbar button:hover {
    background: var(--border-color);
}

.editor-textarea {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* Page Headers */
.page-header h1 {
    color: var(--text-dark);
}

.page-header p {
    color: var(--text-light);
}