* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #0C2D52;
    --accent-yellow: #F4C542;
    --light-bg: #FFFFFF;
    --light-secondary: #F9F9F9;
    --light-text: #0C2D52;
    --light-border: #E2E8F0;
    --sidebar-width: 280px;
    --header-height: 60px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
    --border-radius: 12px;
    --dark-bg: #3A6A8C;
    --dark-secondary: #2A4A6A;
    --dark-text: #FFFFFF;
    --dark-border: #4A7A9C;
}

.dark-mode {
    --bg-color: var(--dark-bg);
    --secondary-bg: var(--dark-secondary);
    --text-color: var(--dark-text);
    --border-color: var(--dark-border);
    --card-bg: var(--dark-secondary);
}

.dark-mode body {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.dark-mode .admin-container,
.dark-mode .main-content {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.dark-mode .content-header h1,
.dark-mode .content-header p,
.dark-mode .stat-info h3,
.dark-mode .stat-info p,
.dark-mode .recent-activity h2,
.dark-mode .activity-details h4,
.dark-mode .activity-time,
.dark-mode .message-title-admin,
.dark-mode .blog-title-admin,
.dark-mode .user-name-admin,
.dark-mode .message-date-admin,
.dark-mode .blog-date-admin,
.dark-mode .user-role-admin {
    color: var(--text-color);
}

.dark-mode .stat-card,
.dark-mode .recent-activity,
.dark-mode .message-item-admin,
.dark-mode .blog-item-admin,
.dark-mode .user-item-admin {
    background: var(--card-bg);
    color: var(--text-color);
    border-color: var(--border-color);
}

.dark-mode .activity-item {
    border-bottom-color: var(--border-color);
}

.dark-mode .activity-item:hover {
    background: var(--dark-bg);
}

.dark-mode .management-actions .btn-primary,
.dark-mode .form-actions .btn-primary {
    background: var(--accent-yellow);
    color: var(--primary-blue);
}

.dark-mode .management-actions .btn-primary:hover,
.dark-mode .form-actions .btn-primary:hover {
    background: var(--primary-blue);
    color: var(--accent-yellow);
}

.dark-mode .management-actions .btn-secondary,
.dark-mode .form-actions .btn-secondary {
    background: var(--border-color);
    color: var(--text-color);
}

.dark-mode .management-actions .btn-secondary:hover,
.dark-mode .form-actions .btn-secondary:hover {
    background: var(--primary-blue);
    color: white;
}

.dark-mode .gallery-item-admin {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.dark-mode .modal-content {
    background: var(--card-bg);
    color: var(--text-color);
}

.dark-mode .modal-header {
    background: var(--dark-secondary);
    border-bottom-color: var(--border-color);
}

.dark-mode .modal-header h2 {
    color: var(--text-color);
}

.dark-mode .close {
    color: var(--text-color);
}

.dark-mode .close:hover {
    color: var(--accent-yellow);
}

.dark-mode .form-group label {
    color: var(--text-color);
}

.dark-mode .form-group input,
.dark-mode .form-group textarea,
.dark-mode .form-group select {
    background: var(--dark-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

.dark-mode .form-group input:focus,
.dark-mode .form-group textarea:focus,
.dark-mode .form-group select:focus {
    border-color: var(--accent-yellow);
    background: var(--dark-bg);
}

.dark-mode .form-group input::placeholder,
.dark-mode .form-group textarea::placeholder {
    color: var(--text-color);
    opacity: 0.7;
}

.dark-mode .activity-placeholder,
.dark-mode .gallery-placeholder,
.dark-mode .message-placeholder,
.dark-mode .blog-placeholder,
.dark-mode .user-placeholder {
    color: var(--text-color);
    background: var(--card-bg);
}

.dark-mode .mobile-header {
    background: var(--primary-blue);
    color: var(--text-color);
}

.dark-mode .sidebar-overlay {
    background: rgba(0, 0, 0, 0.7);
}

.dark-mode .mobile-menu-btn {
    color: var(--accent-yellow);
}

.dark-mode .gallery-item-actions .edit-btn {
    background: var(--accent-yellow);
    color: var(--primary-blue);
}

.dark-mode .gallery-item-actions .delete-btn {
    background: #e53e3e;
    color: white;
}

.dark-mode .message-actions .btn,
.dark-mode .blog-actions .btn,
.dark-mode .user-actions .btn {
    background: var(--border-color);
    color: var(--text-color);
}

.dark-mode .message-actions .btn-primary,
.dark-mode .blog-actions .btn-primary,
.dark-mode .user-actions .btn-primary {
    background: var(--accent-yellow);
    color: var(--primary-blue);
}

.dark-mode .message-actions .btn-danger,
.dark-mode .blog-actions .btn-danger,
.dark-mode .user-actions .btn-danger {
    background: #e53e3e;
    color: white;
}

.dark-mode .message-actions .btn-primary:hover,
.dark-mode .blog-actions .btn-primary:hover,
.dark-mode .user-actions .btn-primary:hover {
    background: var(--primary-blue);
    color: var(--accent-yellow);
}

.dark-mode .protected-badge {
    background: var(--accent-yellow);
    color: var(--primary-blue);
}

.dark-mode .image-preview {
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.dark-mode .modal-header.success {
    background: #48BB78;
    color: white;
}

.dark-mode .modal-header.error {
    background: #E53E3E;
    color: white;
}

.dark-mode #successModal .modal-body,
.dark-mode #errorModal .modal-body,
.dark-mode #confirmModal .modal-body {
    background: var(--card-bg);
    color: var(--text-color);
}

body {
    font-family: 'Open Sans', sans-serif;
    background-color: var(--light-secondary);
    color: var(--light-text);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    font-family: 'Montserrat', sans-serif;
}

.btn-primary {
    background: var(--accent-yellow);
    color: var(--primary-blue);
}

.btn-primary:hover {
    background: var(--primary-blue);
    color: var(--accent-yellow);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--light-border);
    color: var(--light-text);
}

.btn-secondary:hover {
    background: var(--primary-blue);
    color: white;
}

.btn-danger {
    background: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background: #c53030;
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--primary-blue);
    color: white;
    z-index: 1000;
    padding: 0 1rem;
    align-items: center;
    justify-content: space-between;
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.1rem;
}

.mobile-logo i {
    color: var(--accent-yellow);
    font-size: 1.5rem;
}

.mobile-menu-btn {
    background: none;
    border: none;
    color: var(--accent-yellow);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 5px;
    transition: var(--transition);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    backdrop-filter: blur(3px);
}

.sidebar-overlay.active {
    display: block;
}

.admin-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--primary-blue);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 999;
    transition: var(--transition);
}

.sidebar-header {
    padding: 2rem 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0.5rem;
}

.admin-logo i {
    font-size: 2rem;
    color: var(--accent-yellow);
}

.admin-logo h2 {
    font-size: 1.5rem;
    margin-bottom: 0;
    color: white;
}

.sidebar-header p {
    font-size: 0.9rem;
    color: var(--accent-yellow);
    font-style: italic;
}

.sidebar-close {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: var(--transition);
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-menu {
    flex: 1;
    padding: 1.5rem 0;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
    list-style: none;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 0.8rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
    text-decoration: none;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left: 4px solid var(--accent-yellow);
}

.sidebar-menu a i {
    margin-right: 0.8rem;
    width: 20px;
    text-align: center;
}

.back-to-site {
    color: var(--accent-yellow) !important;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.user-avatar {
    font-size: 2rem;
    margin-right: 0.8rem;
    color: var(--accent-yellow);
}

.user-details p {
    margin-bottom: 0.2rem;
}

.user-name {
    font-weight: 600;
}

.user-role {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.logout-btn {
    width: 100%;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.logout-btn i {
    margin-right: 0.5rem;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    transition: var(--transition);
    min-height: 100vh;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.content-header {
    margin-bottom: 2rem;
    padding-top: 1rem;
}

.content-header h1 {
    font-size: 2.5rem;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.content-header p {
    color: var(--light-text);
    opacity: 0.8;
    font-size: 1.1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    transition: var(--transition);
    border-top: 4px solid var(--accent-yellow);
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: var(--accent-yellow);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1.5rem;
    color: var(--primary-blue);
    font-size: 1.3rem;
}

.stat-info h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--primary-blue);
}

.stat-info p {
    color: var(--light-text);
    opacity: 0.8;
    font-size: 0.9rem;
}

.recent-activity {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
}

.recent-activity h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-blue);
    font-size: 1.5rem;
}

.activity-list {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--light-border);
    transition: var(--transition);
}

.activity-item:hover {
    background: var(--light-secondary);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-yellow);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    color: var(--primary-blue);
    font-size: 0.9rem;
}

.activity-details {
    flex: 1;
}

.activity-details h4 {
    margin-bottom: 0.2rem;
    font-size: 1rem;
}

.activity-time {
    font-size: 0.8rem;
    color: var(--light-text);
    opacity: 0.7;
}

.activity-placeholder, .gallery-placeholder, .message-placeholder, .blog-placeholder, .user-placeholder {
    text-align: center;
    padding: 2rem;
    color: var(--light-text);
    opacity: 0.7;
}

.activity-placeholder i, .gallery-placeholder i, .message-placeholder i, .blog-placeholder i, .user-placeholder i {
    font-size: 2.5rem;
    color: var(--accent-yellow);
    margin-bottom: 1rem;
}

.management-actions {
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.gallery-grid-admin {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.gallery-item-admin {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;

    transition: var(--transition);
}

.gallery-item-admin:hover {
    transform: translateY(-5px);
}

.gallery-item-admin img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.gallery-item-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
}

.gallery-item-actions button {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.8rem;
}

.gallery-item-actions .edit-btn {
    background: var(--accent-yellow);
    color: var(--primary-blue);
}

.gallery-item-actions .delete-btn {
    background: #e53e3e;
    color: white;
}

.gallery-item-actions button:hover {
    transform: scale(1.1);
}

.messages-list-admin, .blog-list-admin, .users-list-admin {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message-item-admin, .blog-item-admin, .user-item-admin {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    border-left: 4px solid var(--accent-yellow);
}

.message-item-admin:hover, .blog-item-admin:hover, .user-item-admin:hover {
    transform: translateY(-3px);
}

.message-header-admin, .blog-header-admin, .user-header-admin {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.message-title-admin, .blog-title-admin, .user-name-admin {
    font-weight: 600;
    color: var(--primary-blue);
    flex: 1;
    font-size: 1.1rem;
}

.message-date-admin, .blog-date-admin, .user-role-admin {
    font-size: 0.8rem;
    color: var(--light-text);
    opacity: 0.7;
}

.message-actions, .blog-actions, .user-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {opacity: 0; transform: translateY(-50px);}
    to {opacity: 1; transform: translateY(0);}
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--light-border);
}

.modal-header h2 {
    margin: 0;
    color: var(--primary-blue);
    font-size: 1.5rem;
}

.close {
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    color: var(--light-text);
    transition: var(--transition);
}

.close:hover {
    color: var(--primary-blue);
}

.modal-body {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-blue);
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--light-border);
    border-radius: 8px;
    font-family: 'Open Sans', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: var(--accent-yellow);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.image-preview {
    margin-top: 1rem;
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
}

.activity-icon.gallery {
    background: var(--accent-yellow);
    color: var(--primary-blue);
}

.activity-icon.message {
    background: #48BB78;
    color: white;
}

.activity-icon.user {
    background: #4299E1;
    color: white;
}

.activity-icon.blog {
    background: #9F7AEA;
    color: white;
}

.protected-badge {
    background: var(--accent-yellow);
    color: var(--primary-blue);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
    margin-top: 5px;
}

.protected-badge i {
    margin-right: 4px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn:disabled:hover {
    background: #e53e3e;
    transform: none;
}

.modal-content.small {
    max-width: 400px;
}

.modal-header.success {
    background: #48BB78;
    color: white;
}

.modal-header.error {
    background: #E53E3E;
    color: white;
}

.modal-header.warning {
    background: #ED8936;
    color: white;
}

.modal-header.info {
    background: #4299E1;
    color: white;
}

.alert-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 1rem;
}

.alert-icon.success {
    color: #48BB78;
}

.alert-icon.error {
    color: #E53E3E;
}

.alert-icon.warning {
    color: #ED8936;
}

.alert-icon.info {
    color: #4299E1;
}

/* ========== MOBILE STYLES ========== */
@media (max-width: 992px) {
    .sidebar {
        width: 250px;
    }
    
    .main-content {
        margin-left: 250px;
    }
}

@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }
    
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        z-index: 999;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-close {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
        padding-top: 80px;
    }

    .admin-logo {
        justify-content: center;
        text-align: center;
        flex-direction: column;
        gap: 8px;
    }

    .admin-logo h2 {
        font-size: 1.3rem;
    }

    .sidebar-header {
        padding: 1.5rem 1rem;
    }

    .content-header {
        text-align: center;
        margin-bottom: 1.5rem;
    }

    .content-header h1 {
        font-size: 1.8rem;
    }
    
    .content-header p {
        font-size: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .stat-card {
        padding: 1.2rem;
        flex-direction: column;
        text-align: center;
    }

    .stat-icon {
        margin-right: 0;
        margin-bottom: 1rem;
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .stat-info h3 {
        font-size: 1.5rem;
    }

    .management-actions {
        flex-direction: column;
    }

    .management-actions .btn {
        width: 100%;
        text-align: center;
    }

    .gallery-grid-admin {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }

    .message-header-admin, .blog-header-admin, .user-header-admin {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .message-actions, .blog-actions, .user-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .recent-activity {
        padding: 1.2rem;
    }

    .activity-item {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 0.8rem;
    }

    .activity-icon {
        margin-right: 0;
    }
    
    .activity-details h4 {
        font-size: 0.95rem;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 1rem;
        padding-top: 70px;
    }

    .content-header h1 {
        font-size: 1.6rem;
    }

    .gallery-grid-admin {
        grid-template-columns: 1fr 1fr;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .modal-header {
        padding: 1rem 1.5rem;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }

    .sidebar {
        width: 100%;
    }

    .mobile-menu-btn {
        bottom: 15px;
        right: 15px;
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .message-item-admin, .blog-item-admin, .user-item-admin {
        padding: 1rem;
    }
    
    .message-title-admin, .blog-title-admin, .user-name-admin {
        font-size: 1rem;
    }
}

@media (max-width: 400px) {
    .gallery-grid-admin {
        grid-template-columns: 1fr;
    }
    
    .message-item-admin, .blog-item-admin, .user-item-admin {
        padding: 0.8rem;
    }
    
    .stat-card {
        padding: 0.8rem;
    }
    
    .recent-activity {
        padding: 1rem;
    }
    
    .mobile-logo span {
        font-size: 1rem;
    }
}