:root {
    --bg-primary: #0f0f1e;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #252541;
    --text-primary: #e4e4e7;
    --text-secondary: #a0a0ab;
    --accent-primary: #6366f1;
    --accent-hover: #4f46e5;
    --accent-secondary: #8b5cf6;
    --border-color: #2d2d44;
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
}

/* Light mode theme */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #1a1a2e;
    --text-secondary: #6c757d;
    --accent-primary: #6366f1;
    --accent-hover: #4f46e5;
    --accent-secondary: #8b5cf6;
    --border-color: #dee2e6;
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
}

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

/* Smooth transitions for theme changes */
*,
*::before,
*::after {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: rgba(99, 102, 241, 0.2);
}

/* Ensure images scale properly on mobile */
img {
    max-width: 100%;
    height: auto;
}

/* Prevent text from overflowing on mobile */
p, h1, h2, h3, h4, h5, h6 {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

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

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

.navbar {
    background-color: var(--bg-secondary);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

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

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.navbar-brand:hover {
    color: var(--accent-primary);
}

.navbar-subtitle {
    font-size: 0.7rem;
    font-weight: normal;
    color: var(--text-secondary);
    margin-top: 0.1rem;
    letter-spacing: 0.5px;
}

.navbar-verse-ref {
    display: block;
    margin-top: 0.15rem;
}

.navbar-nav {
    display: flex;
    gap: 1rem;
    list-style: none;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--text-primary);
}

/* Theme toggle button */
.theme-toggle-btn {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    padding: 0;
    color: var(--text-primary);
}

.theme-toggle-btn:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--accent-primary);
    transform: rotate(20deg);
}

.theme-icon-dark,
.theme-icon-light {
    line-height: 1;
}

.theme-icon-light {
    display: none;
}

.btn {
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

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

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-secondary);
}

.btn-logout {
    background-color: transparent;
    color: var(--error);
    border: 1px solid var(--error);
}

.btn-logout:hover {
    background-color: var(--error);
    color: white;
}

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

.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-radius: 10px;
    margin: 2rem 0;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent-primary) 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 2rem;
    margin: 1rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.card-header {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

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

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

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

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

.form-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    display: block;
}

.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
}

.alert-info {
    background-color: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
}

.errorlist {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
    color: var(--error);
}

.errorlist li {
    padding: 0.25rem 0;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.dashboard-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.dashboard-card h3 {
    color: var(--accent-primary);
    margin-bottom: 1rem;
}

.dashboard-card p {
    color: var(--text-secondary);
}

footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem;
    text-align: center;
    margin-top: 4rem;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    /* Reduce padding for mobile */
    .container {
        padding: 1rem;
    }

    /* Navbar adjustments */
    .navbar {
        padding: 1rem;
    }

    .navbar-container {
        flex-direction: column;
        gap: 1rem;
    }

    .navbar-brand {
        align-items: center;
        text-align: center;
        font-size: 1.3rem;
    }

    .navbar-subtitle {
        font-size: 0.6rem;
        text-align: center;
    }

    .navbar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
        width: 100%;
    }

    .nav-link {
        font-size: 0.9rem;
    }

    /* Hero section */
    .hero {
        padding: 2rem 1rem;
    }

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

    .hero p {
        font-size: 0.95rem;
    }

    /* Cards and grids */
    .card {
        padding: 1.5rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Buttons - make them more touch-friendly */
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.95rem;
        min-height: 44px; /* iOS recommended touch target size */
    }

    /* Form controls - bigger for mobile */
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.85rem;
    }

    /* Tables - make scrollable */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    /* Footer */
    footer {
        padding: 1.5rem 1rem;
        font-size: 0.9rem;
    }

    /* Profile pictures - slightly smaller on mobile */
    .profile-pic {
        width: 40px;
        height: 40px;
    }

    .profile-pic-placeholder {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* Extra small devices (phones in portrait) */
@media (max-width: 480px) {
    .navbar-subtitle {
        font-size: 0.55rem;
        line-height: 1.3;
    }

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

    .hero p {
        font-size: 0.9rem;
    }

    .btn {
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }

    .card {
        padding: 1rem;
    }

    .navbar-nav {
        font-size: 0.85rem;
    }
}

/* Notification Badge */
.notification-bell {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--error);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    z-index: 10;
}

/* Navbar Search */
.navbar-search {
    position: relative;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.85rem;
    width: 160px;
    transition: all 0.3s ease;
}

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

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-button {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: color 0.3s ease;
}

.search-button:hover {
    color: var(--accent-primary);
}

@media (max-width: 1024px) {
    .search-input {
        width: 130px;
    }

    .search-input:focus {
        width: 180px;
    }
}

@media (max-width: 768px) {
    .navbar-search {
        width: 100%;
        order: -1;
    }

    .search-form {
        width: 100%;
    }

    .search-input {
        width: 100%;
        flex: 1;
    }

    .search-input:focus {
        width: 100%;
    }
}
