/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar styles */
.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.nav-brand a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

.logo-link {
    display: flex;
    align-items: center;
}

.logo {
    height: 50px;
    width: auto;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
    margin-left: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-link:hover {
    background-color: #34495e;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    white-space: nowrap;
    margin-left: auto;
}

.user-name {
    color: white;
}

.user-name-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
    display: inline-block;
}

.user-name-link:hover {
    background-color: #34495e;
    color: white;
}

.btn-logout {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.btn-logout:hover {
    background-color: #c0392b;
}

/* Main content */
.main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Messages */
.messages {
    margin-bottom: 1rem;
}

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

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Content sections */
.content-header {
    margin-bottom: 2rem;
    text-align: center;
}

.content-header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.content-header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.card h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.card p {
    color: #555;
    line-height: 1.8;
}

/* Login page styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 3rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.login-logo-img {
    height: 60px;
    width: auto;
}

.login-box h1 {
    color: #2c3e50;
    margin-bottom: 2rem;
    text-align: center;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.errorlist {
    list-style: none;
    margin-top: 0.5rem;
}

.errorlist li {
    color: #e74c3c;
    font-size: 0.9rem;
}

.btn-login {
    width: 100%;
    padding: 0.75rem;
    background-color: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-login:hover {
    background-color: #5568d3;
}

/* Button styles - Global sizing */
.btn, .btn-primary, .btn-secondary, .btn-danger, .btn-success, .btn-warning, .btn-info,
.btn-sm, .btn-primary.btn-sm, .btn-secondary.btn-sm, .btn-danger.btn-sm,
.btn-success.btn-sm, .btn-warning.btn-sm, .btn-info.btn-sm {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #667eea !important;
    color: white !important;
}

.btn-primary:hover {
    background-color: #5568d3 !important;
}

.btn-secondary {
    background-color: #7f8c8d !important;
    color: white !important;
}

.btn-secondary:hover {
    background-color: #6c7a7b !important;
}

.btn-danger {
    background-color: #e74c3c !important;
    color: white !important;
}

.btn-danger:hover {
    background-color: #c0392b !important;
}

.btn-success {
    background-color: #28a745 !important;
    color: white !important;
}

.btn-success:hover {
    background-color: #218838 !important;
}

.btn-warning {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

.btn-warning:hover {
    background-color: #e0a800 !important;
}

.btn-info {
    background-color: #17a2b8 !important;
    color: white !important;
}

.btn-info:hover {
    background-color: #138496 !important;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
    background-color: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    display: inline-block;
    margin-right: 0.5rem;
    transition: background-color 0.3s;
}

.btn-small:hover {
    background-color: #5568d3;
}

.btn-small.btn-danger {
    background-color: #e74c3c;
}

.btn-small.btn-danger:hover {
    background-color: #c0392b;
}

/* Blog form styles */
.blog-form .form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

.blog-form textarea.form-control {
    resize: vertical;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

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

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* Data table styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.data-table thead {
    background-color: #f8f9fa;
}

.data-table th {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #2c3e50;
}

.data-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
}

.data-table tr:hover {
    background-color: #f8f9fa;
}

/* Badge styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 3px;
    text-transform: uppercase;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-draft {
    background-color: #f8d7da;
    color: #721c24;
}

/* Profile page styles */
.profile-form .form-group {
    margin-bottom: 1.5rem;
}

.profile-form .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.profile-form .form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.profile-form .form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.profile-form .form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
}

.profile-form hr {
    margin: 2rem 0;
    border: 0;
    border-top: 1px solid #dee2e6;
}

.account-info {
    margin-top: 1rem;
}

.info-row {
    display: flex;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #2c3e50;
    width: 150px;
    flex-shrink: 0;
}

.info-value {
    color: #555;
}

/* Footer */
.footer {
    background-color: #2c3e50;
    color: white;
    padding: 2rem 0;
    margin-top: auto;
}

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

/* Nested dropdown styles for Bootstrap */
.dropdown-menu .dropdown-menu {
    position: absolute;
    left: 100%;
    top: 0;
    margin-left: 0.125rem;
    margin-top: 0;
}

.dropend {
    position: relative;
}

.dropend .dropdown-toggle::after {
    display: inline-block;
    margin-left: 0.255em;
    vertical-align: 0.1em;
    content: "";
    border-top: 0.3em solid transparent;
    border-right: 0;
    border-bottom: 0.3em solid transparent;
    border-left: 0.3em solid;
    position: relative;
    top: 1px;
}

.dropend > .dropdown-menu {
    position: absolute;
    left: 100%;
    top: 0;
    margin-left: 0.125rem;
    margin-top: 0;
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 4px 0;
    transition: 0.3s;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Desktop dropdown styles */
.nav-item-dropdown .dropdown-menu {
    background-color: #34495e;
    border: none;
    margin-top: 0.5rem;
}

.nav-item-dropdown .dropdown-item {
    color: white;
    padding: 0.5rem 1rem;
}

.nav-item-dropdown .dropdown-item:hover {
    background-color: #2c3e50;
    color: white;
}

/* Hide mobile arrow on desktop */
@media (min-width: 769px) {
    .mobile-arrow {
        display: none;
    }
}

/* Site Links */
.site-links-list {
    list-style: none;
    padding-left: 0;
    color: #555;
}

.site-links-list > li {
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

.site-links-list a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.site-links-list a:hover {
    color: #5568d3;
    text-decoration: underline;
}

.site-links-list ul {
    list-style: none;
    padding-left: 2rem;
    margin-top: 0.5rem;
}

.site-links-list ul li {
    margin-bottom: 0.5rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        position: relative;
    }

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

    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #2c3e50;
        padding: 1rem;
        gap: 0;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        max-height: 80vh;
        overflow-y: auto;
        z-index: 1000;
        margin-left: 0;
    }

    .nav-menu.active {
        display: flex !important;
    }

    .nav-item {
        width: 100%;
        margin: 0;
    }

    .nav-link {
        display: block;
        width: 100%;
        padding: 0.75rem 1rem;
    }

    .btn-logout {
        width: 100%;
        margin-top: 0.5rem;
    }

    /* Mobile accordion-style navigation */
    .mobile-arrow {
        display: inline;
        font-size: 0.7em;
        margin-left: 0.5rem;
        transition: transform 0.3s;
    }

    .nav-item-dropdown.open .mobile-arrow {
        transform: rotate(180deg);
    }

    /* Convert Bootstrap dropdowns to mobile accordions */
    .nav-item-dropdown .dropdown-menu {
        position: static !important;
        transform: none !important;
        display: none;
        background-color: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
        margin: 0.5rem 0 0 1rem;
    }

    .nav-item-dropdown.open .dropdown-menu {
        display: block !important;
    }

    .nav-item-dropdown .dropdown-item {
        color: white;
        padding: 0.5rem 1rem;
        background-color: rgba(255, 255, 255, 0.05);
        margin: 0.25rem 0;
        border-radius: 4px;
    }

    .nav-item-dropdown .dropdown-item:hover {
        background-color: #34495e;
    }

    /* Mobile nested menus */
    .dropend {
        position: relative;
    }

    .dropend .dropdown-menu {
        position: static !important;
        display: none;
        padding-left: 1rem;
        margin-top: 0.25rem;
    }

    .dropend.open .dropdown-menu {
        display: block !important;
    }

    /* Disable Bootstrap dropdown toggle on mobile */
    .nav-item-dropdown .dropdown-toggle::after {
        display: none;
    }

    .login-box {
        margin: 1rem;
        padding: 2rem;
    }

    .main-content {
        padding: 0 1rem;
    }

    /* Make cards stack on mobile */
    .card {
        padding: 1rem;
    }
}
