/* Admin and Editor Styles */

/* Login Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    position: relative;
    animation: slideDown 0.3s;
}

.close-modal {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
}

.close-modal:hover {
    color: var(--accent-color);
}

#loginForm {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

#loginForm input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

#loginForm button {
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

#loginForm button:hover {
    background: var(--secondary-color);
}

.error-message {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: none;
}

/* Edit Mode Styles */
.editable {
    position: relative;
    transition: all 0.3s;
}

.edit-mode .editable {
    outline: 2px dashed #3498db;
    outline-offset: 3px;
    cursor: text;
    min-height: 20px;
    min-width: 50px;
    display: inline-block;
}

.edit-mode .editable:hover {
    outline-color: #2ecc71;
    background-color: rgba(46, 204, 113, 0.1);
}

.edit-mode .editable:focus {
    outline: 2px solid #2ecc71;
    background-color: rgba(255, 255, 255, 0.95);
    color: #333;
}

.editable[contenteditable="true"] {
    user-select: text;
    -webkit-user-select: text;
}

/* Edit Toolbar */
.edit-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    z-index: 1500;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s;
}

.toolbar-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 20px;
}

.toolbar-label {
    font-weight: 600;
    font-size: 1.1rem;
    margin-right: auto;
}

.toolbar-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 5px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.toolbar-btn.save {
    background: #2ecc71;
    color: white;
}

.toolbar-btn.save:hover {
    background: #27ae60;
    transform: translateY(-2px);
}

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

.toolbar-btn.cancel:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.toolbar-btn:not(.save):not(.cancel) {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.toolbar-btn:not(.save):not(.cancel):hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Image Upload Overlay */
.image-upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    cursor: pointer;
}

.edit-mode .gallery-item:hover .image-upload-overlay {
    opacity: 1;
    visibility: visible;
}

.upload-button {
    padding: 10px 20px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
}

/* Notification Toast */
.notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: #2ecc71;
    color: white;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 3000;
    animation: slideUp 0.3s;
    display: none;
}

.notification.error {
    background: #e74c3c;
}

.notification.show {
    display: block;
}

/* Admin Dashboard Link */
.admin-dashboard-link {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s;
    z-index: 1000;
    display: none;
}

.admin-dashboard-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.admin-dashboard-link.show {
    display: block;
}

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

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .toolbar-content {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }
    
    .toolbar-label {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .admin-dashboard-link {
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        text-align: center;
    }
}