:root {
    /* Common variables */
    --primary-color: #4a6fa5;
    --primary-hover: #3a5a8c;
    --secondary-color: #6c757d;
    --secondary-hover: #5a6268;
    --success-color: #28a745;
    --camera-color: blue;
    --danger-color: #dc3545;
    --border-radius: 4px;
    --transition: all 0.3s ease;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 70px;
    
    /* Light theme variables (default) */
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    --sidebar-bg: #343a40;
    --sidebar-text: #ffffff;
    --header-bg: #ffffff;
}

/* Dark theme variables */
.theme-dark {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-color: #e0e0e0;
    --text-muted: #aaaaaa;
    --border-color: #444444;
    --light-color: #2c2c2c;
    --dark-color: #ffffff;
    --box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    --sidebar-bg: #000000;
    --sidebar-text: #e0e0e0;
    --header-bg: #1e1e1e;
}

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

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

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

ul {
    list-style: none;
}

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

/* Container */
.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* Login/Register Page */
.login-container {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    width: 100%;
    max-width: 500px;
    overflow: hidden;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: var(--primary-color);
    color: white;
}

.logo i {
    font-size: 2rem;
    margin-right: 10px;
}

.form-container {
    padding: 20px;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
}

.tab.active {
    border-bottom: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

.tab-content {
    position: relative;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

input[type="text"], input[type="password"], input[type="email"], input[type="date"],input[type="number"], select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 111, 165, 0.2);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 15px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    transition: var(--transition);
}

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

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



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

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

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

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

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

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

.btn-block {
    display: block;
    width: 100%;
}



.input-error {
    border: 1px solid red;
}

.text-danger {
    color: red;
    font-size: 0.9em;
    margin-top: 5px;
}

.modal {
    display: none; /* Hide by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Dark background overlay */
    z-index: 1000;
    justify-content: center;
    align-items: center;
    overflow: auto;
}

.modal.show-modal {
    display: flex; /* Flex to center the modal */
}

.modal-content {
    background-color: #fff;
    padding: 20px;
    width: 100%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}


.pagination {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

.page-item {
    margin: 0 3px;
}

.page-link {
    display: block;
    padding: 4px 14px;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.page-link:hover {
    background-color: #f0f0f0;
}

.page-item.active .page-link {
    background-color: #3b5998; /* blue like in your screenshot */
    color: #fff;
    border-color: #3b5998;
}

.page-item.disabled .page-link {
    color: #999;
    pointer-events: none;
    background-color: #fff;
    border-color: #ddd;
}






.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-back {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 500;
    padding: 0;
}

.btn-back i {
    margin-right: 5px;
}

.btn-view {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 8px 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
}

.btn-view i {
    margin-right: 5px;
}

.btn-view:hover {
    background-color: var(--primary-hover);
}

.btn-filter {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 8px 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.btn-filter i {
    margin-right: 5px;
}

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



/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: var(--transition);
    z-index: 1000;
}

.sidebar .logo {
    padding: 15px 20px;
    background-color: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
}

.sidebar .logo i {
    font-size: 1.5rem;
    margin-right: 10px;
}

.nav-menu {
    padding: 20px 0;
}

.nav-menu li {
    margin-bottom: 5px;
}

.nav-menu li a {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
}

.nav-menu li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.nav-menu li a:hover,
.nav-menu li.active a {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Admin/User Info */
.admin-info,
.user-info {
    padding: 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 30%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.details h3 {
    font-size: 1rem;
    margin-bottom: 2px;
}

.details p {
    font-size: 0.8rem;
    opacity: 0.7;
}

.folder-path-container {
    flex-basis: 100%;
}

.folder-path-input {
    display: flex;
    gap: 10px;
    align-items: center;
}

.folder-path {
    flex: 1;
    background-color: var(--light-color);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 20px;
    transition: var(--transition);
}

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

.content-header h1 {
    font-size: 1.5rem;
    color: var(--dark-color);
}

.content-header .actions {
    display: flex;
    gap: 10px;
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    overflow: hidden;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 1.2rem;
    color: var(--dark-color);
}

.card-body {
    padding: 20px;
}

/* Search */
.search-container {
    position: relative;
    width: 250px;
}

.search-input {
    width: 100%;
    padding: 8px 15px 8px 35px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.9rem;
}

.search-container i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: background-color 0.3s ease;
}

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

table th {
    background-color: var(--light-color);
    font-weight: 600;
    text-align: left;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

table tr:hover {
    background-color: var(--light-color);
}

table td.actions {
    display: flex;
    gap: 5px;
}

.view-btn {
    color: var(--primary-color);
}

.view-btn:hover {
    background-color: rgba(74, 111, 165, 0.1);
}

.edit-btn {
    color: green;
    background-color: rgba(40, 167, 69, 0.1);
}

.edit-btn:hover { 
    color: white;   
    background-color: var(--success-color);
}

.delete-btn {
    color: var(--danger-color);
    background-color: rgba(220, 53, 69, 0.1);
}

.delete-btn:hover {
    color: white;   
    background-color: var(--danger-color);
}

.camera-btn {
    color: blue;
    background-color: rgba(37, 59, 182, 0.11);
}

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

.download-btn {
    color: var(--primary-color);
}

.download-btn:hover {
    background-color: rgba(74, 111, 165, 0.1);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 5px;
}

.btn-page {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: white;
    color: var(--dark-color);
    cursor: pointer;
    transition: var(--transition);
}

.btn-page.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-page:hover:not(.active):not(.disabled) {
    background-color: #f5f5f5;
}

.btn-page.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* User Profile */
.profile-section {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    padding: 20px;
}

.profile-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
}

.profile-avatar i {
    font-size: 2rem;
    color: white;
}

.profile-info {
    flex: 1;
}

.profile-info h2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.profile-info p {
    color: var(--secondary-color);
    margin-bottom: 3px;
}

.profile-stats {
    display: flex;
    gap: 20px;
}

.stat {
    text-align: center;
}

.stat h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.profile-actions {
    display: flex;
    gap: 10px;
}

.folder-path {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    margin-top: 10px;
    background-color: #f8f9fa;
}

/* Camera Albums */
.albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.album-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

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

.album-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.album-thumbnail i {
    font-size: 2rem;
    color: white;
}

.album-info {
    text-align: center;
}

.album-info h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: black;
}

.album-info p {
    color: var(--secondary-color);
}

/* Photo Gallery */
.filter-controls {
    gap: 10px;
    display: flex;
    align-items: center;
}

.date-filter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-range {
    display: flex;
    align-items: center;
    gap: 5px;
}

.date-input {
    width: 150px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* Fixed 4 columns */
    gap: 20px;
    margin-bottom: 20px;
}


.photo-item {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: var(--transition);
}

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

.photo-thumbnail {
    position: relative;
    height: 150px;
    overflow: hidden;
}

.photo-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.photo-item:hover .photo-thumbnail img {
    transform: scale(1.05);
}

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.photo-item:hover .photo-overlay {
    opacity: 1;
}

.photo-actions {
    display: flex;
    gap: 10px;
}

.photo-actions .btn-icon {
    background-color: white;
    color: var(--dark-color);
}

.photo-actions .btn-icon:hover {
    background-color: var(--primary-color);
    color: white;
}

.photo-actions .delete-btn {
    color: var(--danger-color) !important;
    background-color: rgb(255 255 255) !important;
}

.photo-actions .delete-btn:hover {
    background-color: var(--danger-color)  !important;
    color: white !important;
}

.photo-info {
    padding: 10px;
}

.photo-date {
    font-size: 0.8rem;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.photo-name {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Hidden */
.hidden {
    display: none;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transition: background-color 0.3s ease;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.2rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--secondary-color);
}

.modal-body {
    padding: 20px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Settings Page Styles */
.settings-section-title {
    font-size: 1.1rem;
    margin: 20px 0 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border-color);
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 5px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    margin-right: 20px;
}

.checkbox-item input[type="checkbox"] {
    margin-right: 5px;
}

.maintenance-actions,
.security-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.maintenance-action,
.security-action {
    background-color: var(--border-color);
    border-radius: var(--border-radius);
    padding: 15px;
    transition: var(--transition);
}

.maintenance-action:hover,
.security-action:hover {
    background-color: var(--light-color);
}

.maintenance-action h3,
.security-action h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.maintenance-action p,
.security-action p {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 0.9rem;
}

/* Theme Preview Styles */
.theme-preview {
    margin-top: 15px;
    margin-bottom: 20px;
}

.theme-preview h4 {
    font-size: 1rem;
    margin-bottom: 10px;
}

.theme-preview-container {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.theme-preview-item {
    width: 200px;
    height: 120px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.theme-preview-item:hover {
    transform: scale(1.05);
    box-shadow: var(--box-shadow);
}

.theme-preview-item.active {
    border: 2px solid var(--primary-color);
}

#theme-preview-light {
    background-color: #f5f5f5;
}

#theme-preview-light .preview-header {
    height: 20px;
    background-color: white;
    border-bottom: 1px solid var(--border-color);
}

#theme-preview-light .preview-sidebar {
    position: absolute;
    left: 0;
    top: 20px;
    width: 30px;
    height: calc(100% - 20px);
    background-color: var(--dark-color);
}

#theme-preview-light .preview-content {
    position: absolute;
    left: 30px;
    top: 20px;
    width: calc(100% - 30px);
    height: calc(100% - 20px);
    background-color: white;
}

#theme-preview-dark {
    background-color: #222;
}

#theme-preview-dark .preview-header {
    height: 20px;
    background-color: #333;
    border-bottom: 1px solid #444;
}

#theme-preview-dark .preview-sidebar {
    position: absolute;
    left: 0;
    top: 20px;
    width: 30px;
    height: calc(100% - 20px);
    background-color: #111;
}

#theme-preview-dark .preview-content {
    position: absolute;
    left: 30px;
    top: 20px;
    width: calc(100% - 30px);
    height: calc(100% - 20px);
    background-color: #333;
}

#theme-preview-system {
    background: linear-gradient(to right, #f5f5f5 50%, #222 50%);
}

#theme-preview-system .preview-header {
    height: 20px;
    background: linear-gradient(to right, white 50%, #333 50%);
    border-bottom: 1px solid var(--border-color);
}

#theme-preview-system .preview-sidebar {
    position: absolute;
    left: 0;
    top: 20px;
    width: 30px;
    height: calc(100% - 20px);
    background: linear-gradient(to right, var(--dark-color) 50%, #111 50%);
}

#theme-preview-system .preview-content {
    position: absolute;
    left: 30px;
    top: 20px;
    width: calc(100% - 30px);
    height: calc(100% - 20px);
    background: linear-gradient(to right, white 50%, #333 50%);
}

/* Responsive Design */
@media (max-width: 992px) {
    .sidebar {
        width: var(--sidebar-collapsed-width);
    }
    
    .sidebar .logo span,
    .nav-menu li a span,
    .admin-info .details,
    .user-info .details {
        display: none;
    }
    
    .sidebar .logo {
        justify-content: center;
    }
    
    .sidebar .logo i {
        margin-right: 0;
    }
    
    .admin-info,
    .user-info {
        justify-content: center;
    }
    
    .avatar {
        margin-right: 0;
    }
    
    .main-content {
        margin-left: var(--sidebar-collapsed-width);
    }
}

@media (max-width: 768px) {
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .content-header .actions {
        width: 100%;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-avatar {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .profile-stats {
        margin-top: 15px;
        justify-content: center;
    }
    
    .date-filter {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .profile-info {
        text-align: center;
    }
    
    .profile-actions {
        justify-content: center;
        margin-top: 15px;
    }
}

@media (max-width: 576px) {
    .albums-grid,
    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    table th,
    table td {
        padding: 8px 10px;
    }
    
    table td.actions {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .maintenance-actions,
    .security-actions {
        grid-template-columns: 1fr;
    }
}