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

html {
    overflow-x: hidden; /* Prevent horizontal scrolling */
    height: 100%; /* Ensure proper height calculation */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #e0e0e0;
    background-color: #1a1a1a;
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

/* Navigation */
.nav-bar {
    background: rgba(26, 26, 26, 0.95);
    padding: 0.5rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #404040;
}

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

.nav-logo {
    color: #ffd700;
    font-weight: bold;
    font-size: 1.2rem;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
    margin-left: 2rem;
}

.nav-link {
    color: #e0e0e0;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    background: none;
    border: none;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
}

.nav-link:hover {
    background-color: rgba(255, 215, 0, 0.1);
    color: #ffd700;
}

.nav-link.active {
    background-color: rgba(255, 215, 0, 0.2);
    color: #ffd700;
    font-weight: bold;
}

/* Dropdown styles */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #2d2d2d;
    min-width: 300px;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid #404040;
    z-index: 1001;
    padding: 1rem;
}

.dropdown.active .dropdown-content,
.nav-item.active .dropdown-content {
    display: block;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: #c0c0c0;
    font-size: 0.9rem;
}

.form-group input {
    padding: 0.5rem;
    border: 1px solid #404040;
    border-radius: 4px;
    background: #1a1a1a;
    color: #e0e0e0;
    font-size: 0.9rem;
}

.form-group input:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.2);
}

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

.btn-primary {
    background: #ffd700;
    color: #1a1a1a;
}

.btn-primary:hover {
    background: #e6c200;
}

.btn-secondary {
    background: #808080;
    color: white;
}

.btn-disabled {
    background: #404040;
    color: #808080;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-disabled:hover {
    background: #404040;
    transform: none;
    box-shadow: none;
}

.btn-secondary:hover {
    background: #505050;
}

.admin-status {
    color: #87ceeb;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* ====== WHM-Style Admin Sidebar ====== */

.admin-sidebar {
    position: fixed;
    left: -260px; /* Hidden by default */
    top: 0;
    width: 260px;
    height: 100vh;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%), url('/images/backgrounds/img_68edbf1ee9c4a_1760411422.jpg');
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: left 0.3s ease;
    overflow-y: auto;
    display: block !important; /* Ensure it's always displayed */
}

.admin-sidebar.open {
    left: 0;
}

/* Hamburger button attached to sidebar */
.sidebar-hamburger {
    position: fixed; /* Fixed positioning to stay at screen edge */
    left: 0; /* At the very edge of screen */
    top: 20px;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%), url('/images/backgrounds/img_68edbf1ee9c4a_1760411422.jpg');
    border: 2px solid #ffd700;
    border-radius: 0 8px 8px 0; /* Rounded on the right side only */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1001; /* Above the sidebar */
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
}

/* When sidebar is open, move hamburger with it */
.admin-sidebar.open .sidebar-hamburger {
    left: 260px; /* Move with the sidebar width */
}

.sidebar-hamburger:hover {
    background: linear-gradient(135deg, #2a5298 0%, #1e3c72 100%), url('/images/backgrounds/img_68edbf1ee9c4a_1760411422.jpg');
    border-color: #fff;
    transform: translateX(5px);
}

.sidebar-hamburger .hamburger-lines {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-hamburger .hamburger-lines span {
    width: 20px;
    height: 2px;
    background: #ffd700;
    transition: all 0.3s ease;
}

.sidebar-hamburger.active .hamburger-lines span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.sidebar-hamburger.active .hamburger-lines span:nth-child(2) {
    opacity: 0;
}

.sidebar-hamburger.active .hamburger-lines span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.sidebar-header {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-title {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.sidebar-content {
    padding: 20px 0;
}

.admin-group {
    margin-bottom: 30px;
    padding: 0 20px;
}

.group-header {
    color: #ffd700;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
}

.admin-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-align: left;
}

.admin-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: #ffd700;
    transform: translateX(5px);
}

.admin-btn.active {
    background: #ffd700;
    color: #1e3c72;
    border-color: #ffd700;
}

.btn-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.btn-text {
    flex: 1;
    font-weight: 500;
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Page wrapper for pushing all content */
.page-wrapper {
    transition: margin-left 0.3s ease;
    min-height: 100vh; /* Always ensure at least full viewport height */
    position: relative;
}

.page-wrapper.sidebar-open {
    margin-left: 260px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-wrapper.sidebar-open {
        margin-left: 0; /* Don't push content on mobile */
    }
    
    .admin-sidebar {
        width: 280px;
        left: -280px;
    }
}

/* Hide old admin actions */
.admin-actions {
    display: none !important;
}

.hamburger-toggle {
    display: none !important;
}

.admin-menu {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    z-index: 999;
}

.hamburger-toggle {
    background: #ffd700;
    color: #1a1a1a;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hamburger-toggle:hover {
    background: #e6c200;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.4);
}

.admin-menu {
    display: none !important;
}

.edit-btn, .add-page-btn, .delete-page-btn, .cancel-btn, .background-btn, .position-bg-btn, .position-content-btn, .drag-mode-btn, .add-textbox-btn, .restore-elements-btn {
    background: #ffd700;
    color: #1a1a1a;
    border: none;
    border-radius: 25px;
    padding: 0.5rem 1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
    white-space: nowrap;
    font-size: 0.75rem;
    min-height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-page-btn {
    background: #87ceeb;
}

.delete-page-btn {
    background: #ff6b6b;
    color: white;
}

.cancel-btn {
    background: #808080;
    color: white;
}

.edit-btn:hover, .add-page-btn:hover, .delete-page-btn:hover, .cancel-btn:hover, .background-btn:hover, .position-bg-btn:hover, .position-content-btn:hover, .drag-mode-btn:hover, .add-textbox-btn:hover, .restore-elements-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
}

.edit-btn:hover {
    background: #e6c200;
}

.add-page-btn:hover {
    background: #5f9ea0;
}

.delete-page-btn:hover {
    background: #ff5252;
}

.cancel-btn:hover {
    background: #696969;
}

.drag-mode-btn {
    background: #4ade80 !important;
    color: white !important;
}

.drag-mode-btn:hover {
    background: #22c55e !important;
}

.add-textbox-btn {
    background: #4ade80 !important;
    color: white !important;
}

.add-textbox-btn:hover {
    background: #22c55e !important;
}

.restore-elements-btn {
    background: #ffa500 !important;
    color: white !important;
}

.restore-elements-btn:hover {
    background: #ff8c00 !important;
}

/* Custom Text Boxes */
.custom-text-box {
    /* Default state - look like normal text */
    border: none;
    padding: 0;
    margin: 1rem 0;
    background: transparent;
    border-radius: 0;
    min-height: auto;
    position: relative;
    cursor: default;
    color: #e6eefb;
    font-family: inherit;
    font-size: inherit;
    line-height: 1.6;
    outline: none;
    transition: all 0.2s ease;
}

/* Editable state - show editing UI */
.custom-text-box[contenteditable="true"] {
    border: 2px dashed #ffd700;
    padding: 1rem;
    background: rgba(255, 215, 0, 0.05);
    border-radius: 8px;
    min-height: 50px;
    cursor: text;
}

/* Placeholder styling */
.custom-text-box.placeholder-text {
    color: #888;
    font-style: italic;
}

.custom-text-box:hover {
    border-color: #fff;
    background: rgba(255, 215, 0, 0.1);
}

.custom-text-box:focus {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.3);
}

.custom-text-box.draggable-text:hover {
    outline: 1px dashed rgba(255, 215, 0, 0.5);
    outline-offset: 4px;
}

.remove-textbox-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ff4444 !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    width: 24px !important;
    height: 24px !important;
    font-size: 12px !important;
    cursor: pointer !important;
    z-index: 1000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
    transition: all 0.2s ease !important;
}

.remove-textbox-btn:hover {
    background: #cc0000 !important;
    transform: scale(1.1) !important;
}

.remove-original-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ff4444 !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    width: 24px !important;
    height: 24px !important;
    font-size: 12px !important;
    cursor: pointer !important;
    z-index: 1000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
    transition: all 0.2s ease !important;
}

.remove-original-btn:hover {
    background: #cc0000 !important;
    transform: scale(1.1) !important;
}

/* Update notification styles */
.update-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: #ffd700;
    color: #1a1a1a;
    padding: 1rem;
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    z-index: 1001;
    font-weight: 500;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

/* Image upload styles */
.upload-zone {
    position: relative;
    transition: all 0.3s ease;
}

.upload-zone-active {
    background: rgba(255, 215, 0, 0.1) !important;
    border: 2px dashed #ffd700 !important;
    transform: scale(1.02);
}

.upload-progress {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(26, 26, 26, 0.95);
    color: #e0e0e0;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.5);
    z-index: 2000;
    min-width: 300px;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
    transition: all 0.3s ease;
}

.upload-progress.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.upload-progress-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.upload-progress-message {
    flex: 1;
}

.upload-progress-close {
    background: none;
    border: none;
    color: #c0c0c0;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-progress-close:hover {
    color: #ffd700;
}

.upload-progress-success {
    border-left: 4px solid #4caf50;
}

.upload-progress-error {
    border-left: 4px solid #f44336;
}

.background-upload-hint {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: #ffd700;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    z-index: 10;
    animation: fadeInBounce 0.5s ease;
}

.upload-hint-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.upload-hint-content button {
    background: none;
    border: none;
    color: #c0c0c0;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
}

.upload-hint-content button:hover {
    color: #ffd700;
}

@keyframes fadeInBounce {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Inline image styles */
.inline-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 0.5rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.inline-image:hover {
    transform: scale(1.02);
}

/* Background Selector Modal */
.background-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.background-selector-modal.show {
    opacity: 1;
    visibility: visible;
}

.background-selector-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    cursor: pointer;
}

.background-selector-content {
    position: relative;
    background: #2a2a2a;
    margin: 2rem auto;
    max-width: 900px;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.background-selector-modal.show .background-selector-content {
    transform: scale(1);
}

.background-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #404040;
    background: #1a1a1a;
}

.background-selector-header h3 {
    margin: 0;
    color: #ffd700;
    font-size: 1.25rem;
}

.header-subtitle {
    margin: 0.5rem 0 0 0;
    color: #a0a0a0;
    font-size: 0.85rem;
    font-style: italic;
}

.close-btn {
    background: none;
    border: none;
    color: #c0c0c0;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #404040;
    color: #ffd700;
}

.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.background-selector-modal .save-btn,
.background-selector-modal .cancel-btn {
    background: #ffd700;
    color: #1a1a1a;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s;
}

.background-selector-modal .save-btn:hover {
    background: #e6c200;
    transform: translateY(-1px);
}

.background-selector-modal .cancel-btn {
    background: transparent;
    color: #ffd700;
    border: 1px solid #ffd700;
}

.background-selector-modal .cancel-btn:hover {
    background: rgba(255, 215, 0, 0.1);
}

.background-selector-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.background-card {
    background: #1a1a1a;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.background-card.clickable {
    cursor: pointer;
}

.background-card.clickable:hover {
    border-color: #ffd700;
    transform: translateY(-2px);
}

.background-card.current {
    border-color: #4caf50;
    cursor: default;
}

.background-preview {
    height: 120px;
    background-size: cover;
    background-position: center;
    position: relative;
    transition: all 0.2s ease;
}

.current-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #4caf50;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

.click-hint {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 215, 0, 0.9);
    color: #1a1a1a;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.background-preview.clickable:hover .click-hint {
    opacity: 1;
}

/* No Background Card Styles */
.background-card.no-background .background-preview.no-bg-preview {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%), url('/images/backgrounds/img_68edbf1ee9c4a_1760411422.jpg');
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed #666;
}

.no-bg-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

.no-bg-text {
    font-size: 1rem;
    font-weight: bold;
    color: #a0a0a0;
    text-align: center;
}

.background-card.no-background.current .background-preview {
    border-color: #4caf50;
    background: linear-gradient(135deg, #2d4a2d 0%, #1a3a1a 100%), url('/images/backgrounds/img_68edbf1ee9c4a_1760411422.jpg');
}

.background-card.no-background.current .no-bg-text {
    color: #4caf50;
}

.background-info {
    padding: 1rem;
}

.background-name {
    font-weight: bold;
    color: #e0e0e0;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.background-meta {
    font-size: 0.8rem;
    color: #a0a0a0;
}

.background-actions {
    padding: 0 1rem 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.background-selector-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #404040;
    background: #1a1a1a;
}

.background-drop-zone {
    border: 2px dashed #404040;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    color: #a0a0a0;
    background: #2a2a2a;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 1rem;
}

.background-drop-zone:hover {
    border-color: #ffd700;
    color: #ffd700;
    background: rgba(255, 215, 0, 0.05);
}

.background-drop-zone.upload-zone-active {
    border-color: #ffd700 !important;
    color: #ffd700 !important;
    background: rgba(255, 215, 0, 0.1) !important;
    transform: scale(1.02);
}

.help-text {
    margin: 0;
    color: #a0a0a0;
    font-size: 0.9rem;
    text-align: center;
}

.no-backgrounds {
    text-align: center;
    color: #a0a0a0;
    font-style: italic;
    padding: 2rem;
    grid-column: 1 / -1;
}

.background-btn {
    background: #9370db;
    color: white;
}

.background-btn:hover {
    background: #8a2be2;
}

.position-bg-btn {
    background: #ff8c00;
    color: white;
}

.position-bg-btn:hover {
    background: #ff7700;
}

.position-content-btn {
    background: #32cd32;
    color: white;
}

.position-content-btn:hover {
    background: #28a428;
}

/* Responsive inline images */
@media (max-width: 768px) {
    .inline-image {
        max-width: 100%;
        margin: 0.25rem 0;
    }
    
    .background-upload-hint {
        top: 10px;
        right: 10px;
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }
    
    .upload-progress {
        min-width: 280px;
        margin: 0 10px;
    }
    
    .background-selector-content {
        margin: 1rem;
        max-height: 90vh;
    }
    
    .background-selector-body {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .background-selector-header {
        padding: 1rem;
    }
}

.notification-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.notification-message {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.notification-refresh, .notification-dismiss {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
}

.notification-refresh {
    background: #ffd700;
    color: #1a1a1a;
}

.notification-dismiss {
    background: #808080;
    color: white;
}

.notification-refresh:hover {
    background: #e6c200;
}

.notification-dismiss:hover {
    background: #696969;
}

/* Dynamic content system */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.loading {
    text-align: center;
    color: #808080;
    padding: 2rem;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #404040;
    border-radius: 50%;
    border-top-color: #ffd700;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* User admin specific styles - Compact Design */
.user-admin-section {
    padding: 0;
}

.user-admin-content {
    padding: 0.5rem;
}

.user-card {
    background: #1a1a1a;
    border: 1px solid #404040;
    border-radius: 4px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

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

.user-status {
    font-size: 0.75em;
    padding: 2px 6px;
    border-radius: 8px;
    background: #404040;
}

.user-status.active {
    background: #87ceeb;
    color: #1a1a1a;
}

.user-actions {
    margin-top: 8px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-small {
    padding: 3px 8px;
    font-size: 0.75em;
    border-radius: 3px;
}

.btn-danger {
    background: #ff6b6b;
    color: white;
}

.btn-danger:hover {
    background: #ff5252;
}

.btn-warning {
    background: #ffa726;
    color: #1a1a1a;
}

.btn-warning:hover {
    background: #ff9800;
}

.admin-section {
    background: rgba(45, 45, 45, 0.5);
    border-radius: 4px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid #404040;
}

.admin-section h3 {
    color: #ffd700;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #404040;
    padding-bottom: 0.2rem;
    font-size: 1rem;
}

.form-row {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
    align-items: center;
}

.form-row .form-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
}

.form-row .form-group.username-field {
    flex: 0 0 180px;
}

.form-row .form-group.email-field {
    flex: 0 0 140px;
}

.form-row .form-group.password-field {
    flex: 0 0 160px;
}

.form-row .form-group label {
    white-space: nowrap;
    font-size: 0.8rem;
    min-width: fit-content;
    margin-bottom: 0;
}

.form-row .form-group input {
    flex: 1;
    min-width: 0;
}

.admin-section .form-group {
    margin-bottom: 6px;
}

.admin-section .form-group label {
    font-size: 0.8em;
    margin-bottom: 0;
}

.admin-section .form-group input {
    padding: 5px 6px;
    font-size: 0.8em;
    border-radius: 3px;
    height: 29px;
    box-sizing: border-box;
}

.admin-section .btn {
    padding: 5px 10px;
    font-size: 0.8em;
}

.button-group {
    display: flex;
    gap: 4px;
    flex: 0 0 auto;
    align-items: center;
    margin-left: 8px;
}

.button-group .btn {
    white-space: nowrap;
    height: 27px;
    padding: 4px 8px;
    font-size: 0.75em;
}

.confirm-input {
    background: #3d1a1a !important;
    border-color: #ff6b6b !important;
}

.delete-form {
    margin-top: 10px;
    padding: 10px;
    border-top: 1px solid #404040;
    background: rgba(255, 107, 107, 0.05);
    border-radius: 3px;
}

.user-details {
    font-size: 0.8em;
    color: #c0c0c0;
    margin-bottom: 8px;
    line-height: 1.3;
}

.user-details div {
    display: inline-block;
    margin-right: 15px;
    margin-bottom: 2px;
}

/* Header section */
.header {
    position: relative;
    height: 40vh;
    min-height: 100px;
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('/images/backgrounds/img_68edbf1ee9c4a_1760411422.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    margin-top: 60px; /* Account for fixed nav */
}

.header-content h1 {
    font-size: 3.5rem;
    font-weight: 300;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

/* Make site title clearly editable when in edit mode but not in drag mode */
#siteTitle[contenteditable="true"]:not(.draggable-text) {
    border: 2px dashed #ffd700 !important;
    padding: 5px !important;
    border-radius: 4px !important;
    background: rgba(255, 215, 0, 0.1) !important;
    cursor: text !important;
}

#siteTitle[contenteditable="true"]:not(.draggable-text):hover {
    background: rgba(255, 215, 0, 0.2) !important;
}

/* When in drag mode, override edit mode styling */
#siteTitle.draggable-text {
    cursor: move !important;
    border: 2px solid #ffd700 !important;
    background: rgba(255, 215, 0, 0.05) !important;
}

/* Make nav logo editable */
#navLogo[contenteditable="true"] {
    border: 2px dashed #ffd700 !important;
    padding: 5px !important;
    border-radius: 4px !important;
    background: rgba(255, 215, 0, 0.1) !important;
    cursor: text !important;
    text-decoration: none !important;
    pointer-events: auto !important;
}

#navLogo[contenteditable="true"]:hover {
    background: rgba(255, 215, 0, 0.2) !important;
    text-decoration: none !important;
}

/* Make page names editable in navigation */
.editable-page-name[contenteditable="true"] {
    border: 2px dashed #ffd700 !important;
    border-radius: 4px !important;
    background: rgba(255, 215, 0, 0.1) !important;
    cursor: text !important;
    padding: 0.5rem 1rem !important;
}

.editable-page-name[contenteditable="true"]:hover {
    background: rgba(255, 215, 0, 0.2) !important;
}

.editable-page-name[contenteditable="true"]:focus {
    outline: none !important;
    background: rgba(255, 215, 0, 0.25) !important;
    border-color: #ffed4e !important;
}

.header-content .header-subtitle {
    font-size: 1.2rem;
    font-weight: 400;
    color: #ffd700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

/* Container and content */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    transition: max-width 0.3s ease;
    overflow: visible; /* Allow transforms but don't create scrollbars */
}

.container.resizing {
    transition: none;
}

.content {
    background: #2d2d2d;
    margin: -50px auto 50px;
    padding: 60px 40px 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 10;
    border: 1px solid #404040;
}

/* Resize handles */
.resize-handle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 60px;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 10px;
    cursor: col-resize;
    z-index: 15;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resize-handle:before {
    content: '⋮⋮';
    color: #ffd700;
    font-size: 12px;
    letter-spacing: -2px;
    line-height: 1;
}

.resize-handle:hover,
.container:hover .resize-handle {
    opacity: 1;
    background: rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.5);
}

.resize-handle.active {
    opacity: 1;
    background: rgba(255, 215, 0, 0.3);
    border-color: #ffd700;
}

.resize-handle-left {
    left: -30px;
}

.resize-handle-right {
    right: -30px;
}

.width-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(26, 26, 26, 0.95);
    color: #ffd700;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid #ffd700;
    font-size: 0.9rem;
    font-weight: bold;
    z-index: 2001;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.width-indicator.show {
    opacity: 1;
}

/* Tooltip for resize handles */
.resize-handle::after {
    content: 'Drag to resize • Double-click to reset';
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(26, 26, 26, 0.95);
    color: #ffd700;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 20;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.resize-handle:hover::after {
    opacity: 1;
}

/* Background Position Controls */
.background-position-controls {
    position: fixed;
    top: 100px;
    right: 20px;
    background: #2a2a2a;
    border: 1px solid #404040;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1500;
    min-width: 280px;
    opacity: 0;
    animation: slideInFromRight 0.3s ease forwards;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.bg-controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #404040;
    background: #1a1a1a;
    border-radius: 8px 8px 0 0;
}

.bg-controls-header h4 {
    margin: 0;
    color: #ffd700;
    font-size: 1rem;
}

.bg-controls-close {
    background: none;
    border: none;
    color: #c0c0c0;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.bg-controls-close:hover {
    background: #404040;
    color: #ffd700;
}

.bg-controls-body {
    padding: 1rem;
}

.bg-control-group {
    margin-bottom: 1rem;
}

.bg-control-group:last-of-type {
    margin-bottom: 1.5rem;
}

.bg-control-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #e0e0e0;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.bg-control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #404040;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.bg-control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffd700;
    cursor: pointer;
    border: 2px solid #1a1a1a;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.bg-control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffd700;
    cursor: pointer;
    border: 2px solid #1a1a1a;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.bg-control-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
}

.bg-reset-btn,
.bg-save-btn {
    flex: 1;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
    transition: all 0.2s ease;
}

.bg-reset-btn {
    background: #808080;
    color: white;
}

.bg-reset-btn:hover {
    background: #696969;
}

.bg-save-btn {
    background: #ffd700;
    color: #1a1a1a;
}

.bg-save-btn:hover {
    background: #e6c200;
    transform: translateY(-1px);
}

/* Content Position Controls */
.content-position-controls {
    position: fixed;
    top: 100px;
    left: 20px;
    background: #2a2a2a;
    border: 1px solid #404040;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1500;
    min-width: 280px;
    opacity: 0;
    animation: slideInFromLeft 0.3s ease forwards;
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.content-controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #404040;
    background: #1a1a1a;
    border-radius: 8px 8px 0 0;
}

.content-controls-header h4 {
    margin: 0;
    color: #32cd32;
    font-size: 1rem;
}

.content-controls-close {
    background: none;
    border: none;
    color: #c0c0c0;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.content-controls-close:hover {
    background: #404040;
    color: #32cd32;
}

.content-controls-body {
    padding: 1rem;
}

.content-control-group {
    margin-bottom: 1.5rem;
}

.content-control-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #e0e0e0;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.content-control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #404040;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.content-control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #32cd32;
    cursor: pointer;
    border: 2px solid #1a1a1a;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.content-control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #32cd32;
    cursor: pointer;
    border: 2px solid #1a1a1a;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #a0a0a0;
    margin-top: 0.25rem;
}

.content-control-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
}

.content-reset-btn,
.content-save-btn {
    flex: 1;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
    transition: all 0.2s ease;
}

.content-reset-btn {
    background: #808080;
    color: white;
}

.content-reset-btn:hover {
    background: #696969;
}

.content-save-btn {
    background: #32cd32;
    color: #1a1a1a;
}

.content-save-btn:hover {
    background: #28a428;
    transform: translateY(-1px);
}

/* Typography */
.main-title {
    font-size: 2.5rem;
    color: #ffd700;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 300;
}

.main-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #c0c0c0;
    margin-bottom: 1.5rem;
}

.signature {
    margin-top: 2rem;
    font-style: italic;
    color: #87ceeb;
    text-align: right;
    border-top: 1px solid #404040;
    padding-top: 1rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 0;
    color: #808080;
    font-size: 0.9rem;
}

/* Mobile navigation */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle:hover {
    color: #ffd700;
}

/* Responsive design */
@media (max-width: 768px) {
    .nav-container {
        position: relative;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(26, 26, 26, 0.98);
        border: 1px solid #404040;
        border-radius: 8px;
        margin-top: 10px;
        padding: 1rem;
        flex-direction: column;
        z-index: 1002;
    }
    
    .nav-menu.mobile-active {
        display: flex;
    }
    
    .nav-item {
        margin: 0.5rem 0;
        width: 100%;
    }
    
    .nav-link {
        display: block;
        width: 100%;
        text-align: left;
        padding: 0.75rem 1rem;
    }
    
    /* Hide the Admin button on mobile - show content directly */
    #adminToggle {
        display: none;
    }
    
    .dropdown-content {
        position: static;
        display: block !important;
        box-shadow: none;
        border: none;
        background: rgba(45, 45, 45, 0.8);
        margin-top: 0;
        width: 100%;
        border-radius: 8px;
        padding: 1rem;
    }
    
    .dropdown.active .dropdown-content,
    .nav-item.active .dropdown-content {
        display: block !important;
    }
    
    .header-content h1 {
        font-size: 2.5rem;
    }
    
    .content {
        margin: -30px 20px 30px;
        padding: 40px 25px 25px;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .admin-actions {
        bottom: 10px;
        right: 10px;
        gap: 8px;
    }
    
    .hamburger-toggle {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    .admin-menu {
        min-width: 180px;
        padding: 12px;
    }
    
    .edit-btn, .add-page-btn, .delete-page-btn, .cancel-btn, .background-btn, .position-bg-btn, .position-content-btn, .drag-mode-btn, .add-textbox-btn, .restore-elements-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.7rem;
        min-height: 32px;
    }
    
    /* Mobile user admin form fixes */
    .form-row {
        flex-direction: column;
        gap: 4px !important;
        align-items: stretch;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .form-row .form-group {
        flex-direction: column;
        align-items: stretch;
        gap: 2px !important;
        flex: none;
        width: 100%;
        margin: 0 !important;
        padding: 0 !important;
        min-height: auto;
    }
    
    .admin-section .form-group {
        margin: 0 !important;
        padding: 0 !important;
        gap: 2px !important;
    }
    
    .admin-section {
        padding: 0.5rem !important;
        margin: 0 !important;
    }
    
    .form-row .form-group label {
        font-size: 0.9rem;
        margin: 0 0 2px 0 !important;
        padding: 0 !important;
        text-align: left;
        line-height: 1.2;
    }
    
    .form-row .form-group input {
        width: 100%;
        height: 2.5rem !important;
        min-height: 2.5rem;
        max-height: 2.5rem;
        padding: 8px 10px;
        font-size: 0.9rem;
        line-height: 1.2;
        box-sizing: border-box;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        resize: none;
        vertical-align: top;
    }
    
    .button-group {
        flex-direction: row;
        justify-content: center;
        gap: 8px;
        margin-top: 8px;
        margin-left: 0;
    }
    
    .button-group .btn {
        flex: 1;
        max-width: 120px;
        height: auto;
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .admin-section {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .user-card {
        padding: 1rem;
    }
    
    .user-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .user-actions .btn {
        width: 100%;
        text-align: center;
    }
    
    .user-details {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .user-details div {
        display: block;
        margin-right: 0;
        margin-bottom: 6px;
    }
}

@media (max-width: 480px) {
    .header {
        height: 35vh;
        min-height: 80px;
    }
    
    .header-content h1 {
        font-size: 2rem;
    }
    
    /* Ultra-mobile user admin form fixes */
    .admin-section {
        padding: 0.5rem !important;
        margin: 0 !important;
    }
    
    .form-row {
        flex-direction: column !important;
        gap: 2px !important;
        align-items: stretch !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .form-row + .form-row {
        margin-top: 4px !important;
    }
    
    .form-group {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1px !important;
        flex: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        min-height: auto !important;
    }
    
    .form-group label {
        font-size: 0.85rem !important;
        margin: 0 0 1px 0 !important;
        padding: 0 !important;
        text-align: left !important;
        line-height: 1.1 !important;
    }
    
    .form-group input {
        width: 100% !important;
        height: 2.2rem !important;
        min-height: 2.2rem !important;
        max-height: 2.2rem !important;
        padding: 6px 8px !important;
        font-size: 0.85rem !important;
        line-height: 1.1 !important;
        box-sizing: border-box !important;
        margin: 0 !important;
    }
    
    .content {
        margin: -20px 15px 20px;
        padding: 30px 20px 20px;
    }
    
    .main-title {
        font-size: 1.8rem;
    }
    
    /* Hide resize handles on mobile */
    .resize-handle {
        display: none;
    }
    
    /* Mobile background position controls */
    .background-position-controls {
        top: 80px;
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }
    
    .bg-controls-body {
        padding: 0.75rem;
    }
    
    .bg-control-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .bg-reset-btn,
    .bg-save-btn {
        width: 100%;
    }
    
    /* Mobile content position controls */
    .content-position-controls {
        top: 80px;
        left: 10px;
        right: 10px;
        min-width: auto;
    }
    
    .content-controls-body {
        padding: 0.75rem;
    }
    
    .content-control-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .content-reset-btn,
    .content-save-btn {
        width: 100%;
    }
}

/* Draggable Text Elements */
.draggable-text {
    transition: transform 0.2s ease;
    position: relative;
}

.draggable-text:hover {
    background: rgba(255, 215, 0, 0.05);
    outline: 1px dashed rgba(255, 215, 0, 0.3);
    outline-offset: 2px;
    border-radius: 4px;
}

.draggable-text.dragging {
    z-index: 1000;
    background: rgba(255, 215, 0, 0.1);
    outline: 2px solid rgba(255, 215, 0, 0.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Ensure page has enough dragging space - only when actively dragging */
/* Dynamic height management is now handled by JavaScript based on element positions */

/* Container for draggable elements should allow overflow */
.home-content, .content, .page-content {
    position: relative;
    overflow: visible;
    min-height: inherit;
}

.drag-handle {
    font-family: monospace;
    letter-spacing: -2px;
    font-weight: bold;
}

.drag-position-indicator {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Mobile draggable adjustments */
@media (max-width: 768px) {
    .drag-handle {
        left: -20px !important;
        font-size: 12px !important;
    }
    
    .drag-position-indicator {
        right: 10px !important;
        font-size: 0.8rem !important;
    }
}