/* Admin Panel Styles */

/* Login Screen */
.login-screen {
    min-height: 100vh !important;
    width: 100vw !important;
    height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, var(--accent-color) 0%, #ffffff 100%) !important;
    padding: 20px !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 1000 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    transform: translate(0, 0) !important;
}


.login-container {
    background: var(--white);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 100%;
    text-align: center;
    margin: 0 auto;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
}

.login-header {
    margin-bottom: 2rem;
}

.login-header i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.login-header h1 {
    font-family: "Playfair Display", serif;
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.login-form input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.password-input-container {
    position: relative;
    width: 100%;
}

.password-input-container input {
    padding-right: 3rem; /* Spazio per l'icona */
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-light);
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: var(--primary-color);
}

.login-btn {
    width: 100%;
    background: var(--primary-color);
    color: var(--white);
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.login-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.login-error {
    color: #e74c3c;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.back-link {
    display: inline-block;
    margin-top: 1.5rem;
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--primary-color);
}

/* Admin Panel */
.admin-panel {
    min-height: 100vh;
    background: #f5f5f5;
    display: block !important; /* Forza la visualizzazione */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

/* Nascondi pulsanti specifici per sicurezza */
.whatsapp-btn,
#downloadSelectedBtn,
#downloadAllBtn {
    display: none !important;
}

/* Migliora layout pulsanti rimanenti */
.admin-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.admin-actions .btn {
    min-width: 120px;
    text-align: center;
}

/* Migliora layout azioni media */
.media-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}

.media-actions .action-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Admin Header */
.admin-header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.admin-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: "Playfair Display", serif;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.admin-actions {
    display: flex;
    gap: 1rem;
}

.btn-secondary, .btn-danger, .btn-primary, .btn-success, .btn-tool {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

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

.btn-danger:hover:not(:disabled) {
    background: #c0392b;
    transform: translateY(-2px);
}

.btn-danger:disabled {
    background: #ccc;
    cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
    transform: translateY(-2px);
}

.btn-tool {
    background: #ecf0f1;
    color: var(--text-dark);
}

.btn-tool:hover {
    background: #d5dbdb;
}

/* Stats Bar */
.stats-bar {
    background: var(--white);
    padding: 1.5rem 2rem;
    max-width: 1400px;
    margin: 1rem auto;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-item i {
    font-size: 2rem;
    color: var(--primary-color);
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* Toolbar */
.toolbar {
    background: var(--white);
    padding: 1rem 2rem;
    max-width: 1400px;
    margin: 1rem auto;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.toolbar-left, .toolbar-right {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.selection-count {
    font-weight: 600;
    color: var(--primary-color);
    padding: 0.6rem 1rem;
    background: rgba(109, 139, 126, 0.1);
    border-radius: 8px;
}

/* Filters */
.filters {
    background: var(--white);
    padding: 1rem 2rem;
    max-width: 1400px;
    margin: 1rem auto;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-dark);
}

.filter-group select {
    padding: 0.5rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Admin Gallery */
.admin-gallery {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.admin-media-item {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    position: relative;
}

.admin-media-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.admin-media-item.selected {
    border: 3px solid var(--primary-color);
}

.media-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    z-index: 10;
    accent-color: var(--primary-color);
}

.favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: var(--transition);
}

.favorite-btn:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

.favorite-btn.active {
    color: #f39c12;
}

.media-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    cursor: pointer;
}

.media-actions {
    padding: 1rem;
    display: flex;
    justify-content: space-around;
    border-top: 1px solid #eee;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
    padding: 0.5rem;
}

.action-btn:hover {
    color: var(--primary-color);
    transform: scale(1.2);
}

.action-btn.delete:hover {
    color: #e74c3c;
}

.media-info {
    padding: 0.8rem;
    border-top: 1px solid #eee;
}

.media-info p {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0.2rem 0;
}

/* Loading */
.admin-loading {
    text-align: center;
    padding: 4rem;
    color: var(--text-light);
}

.admin-loading i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Empty State */
.admin-empty {
    text-align: center;
    padding: 4rem;
    color: var(--text-light);
}

.admin-empty i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.admin-empty h3 {
    font-family: "Playfair Display", serif;
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

/* Preview Modal */
.preview-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
}

.preview-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-content {
    background: var(--white);
    border-radius: 15px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    position: relative;
}

.preview-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    color: var(--white);
    background: rgba(0, 0, 0, 0.5);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
}

.preview-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.preview-media-container {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 70vh;
}

.preview-media-container img,
.preview-media-container video {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.preview-info {
    padding: 1.5rem;
}

.preview-info h3 {
    font-family: "Playfair Display", serif;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.preview-info p {
    color: var(--text-light);
    margin: 0.5rem 0;
}

/* RSVP Admin Styles */
.search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--white);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--primary-color);
}

.search-box i {
    color: var(--text-light);
}

.search-box input {
    border: none;
    outline: none;
    font-size: 1rem;
    width: 300px;
}

.rsvp-table-container {
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    overflow-x: auto;
    box-shadow: var(--shadow);
}

.rsvp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.rsvp-table thead {
    background: var(--accent-color);
}

.rsvp-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 2px solid var(--primary-color);
}

.rsvp-table td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    color: var(--text-dark);
}

.rsvp-table tbody tr {
    transition: var(--transition);
}

.rsvp-table tbody tr:hover {
    background: rgba(109, 139, 126, 0.05);
}

.badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

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

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

.actions-cell {
    display: flex;
    gap: 0.5rem;
}

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

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

.delete-btn {
    background: #dc3545;
}

.delete-btn:hover {
    background: #c82333;
}

/* RSVP Details Modal */
.rsvp-details {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
}

.rsvp-details h3 {
    font-family: "Playfair Display", serif;
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
    text-align: center;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.detail-item {
    padding: 1rem;
    background: rgba(109, 139, 126, 0.05);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-item strong {
    display: block;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.detail-item span,
.detail-item p {
    color: var(--text-dark);
    font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-header-content {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .stats-bar {
        grid-template-columns: 1fr 1fr;
        padding: 1rem;
    }
    
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toolbar-left, .toolbar-right {
        justify-content: center;
    }
    
    .admin-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .search-box input {
        width: 200px;
    }
    
    .rsvp-table {
        font-size: 0.8rem;
    }
    
    .rsvp-table th,
    .rsvp-table td {
        padding: 0.5rem;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
}

