/* File: frontend/html/css/base.css */
/* Styles fondamentali e reset */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #fafafa;
    color: #333;
    line-height: 1.6;
}

/* Page System */
.page {
    display: none;
}

.page.active {
    display: block;
}

.content-page {
    display: none;
}

.content-page.active {
    display: block;
}

/* Main Content */
.main-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.main-content h2 {
    margin-bottom: 2rem;
    color: #2c3e50;
    font-weight: 300;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast notifications - Bottom right corner */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
}

.toast {
    padding: 12px 16px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    line-height: 1.4;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease-in-out;
    position: relative;
    min-width: 280px;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.hide {
    opacity: 0;
    transform: translateX(100%);
}

.toast-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.toast-error {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.toast-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    opacity: 1;
}

/* Modal/Confirm Dialog */
.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10000 !important;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1 !important;
    visibility: visible !important;
}

.modal {
    background: white !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2) !important;
    max-width: 400px !important;
    width: 90% !important;
    padding: 0 !important;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    position: relative !important;
}

.modal-overlay.show .modal {
    transform: translateY(0) !important;
}

.modal-header {
    padding: 20px 24px 16px !important;
    border-bottom: 1px solid #e1e8ed !important;
    margin: 0 !important;
}

.modal-title {
    margin: 0 !important;
    font-size: 18px !important;
    font-weight: 500 !important;
    color: #2c3e50 !important;
}

.modal-body {
    padding: 20px 24px !important;
    color: #666 !important;
    line-height: 1.5 !important;
    margin: 0 !important;
}

.modal-footer {
    padding: 16px 24px 20px !important;
    border-top: 1px solid #e1e8ed !important;
    display: flex !important;
    gap: 12px !important;
    justify-content: flex-end !important;
    margin: 0 !important;
}

.modal-btn {
    padding: 8px 16px !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    min-width: 80px !important;
    display: inline-block !important;
}

.modal-btn-cancel {
    background: #f8f9fa !important;
    color: #6c757d !important;
    border: 1px solid #dee2e6 !important;
}

.modal-btn-cancel:hover {
    background: #e9ecef !important;
    color: #5a6268 !important;
}

.modal-btn-danger {
    background: #dc3545 !important;
    color: white !important;
}

.modal-btn-danger:hover {
    background: #c82333 !important;
}

.modal-btn-primary {
    background: #3498db !important;
    color: white !important;
}

.modal-btn-primary:hover {
    background: #2980b9 !important;
}

/* Legacy support for existing error/success messages */
.error-message,
.success-message {
    display: none;
}
