/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --whatsapp-green: #25D366;
    --whatsapp-teal: #128C7E;
    --google-blue: #4285F4;
    --google-red: #EA4335;
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    color: var(--gray-900);
    line-height: 1.6;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

/* ===== HAMBURGER BUTTON ===== */
.hamburger-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.hamburger-btn:hover {
    transform: scale(1.1);
}

.hamburger-btn i {
    font-size: 20px;
    color: var(--bg-gradient-start);
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    left: -300px;
    top: 0;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    z-index: 1002;
    overflow-y: auto;
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-900);
}

.close-sidebar {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray-600);
    cursor: pointer;
}

.close-sidebar:hover {
    color: var(--google-red);
}

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

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: var(--gray-600);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: var(--gray-50);
    color: var(--bg-gradient-start);
}

.sidebar-link.active {
    background: #eef2ff;
    color: var(--bg-gradient-start);
    border-left-color: var(--bg-gradient-start);
    font-weight: 500;
}

.sidebar-link i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

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

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

/* ===== HEADER ===== */
.header {
    text-align: center;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    padding: 20px 30px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.header-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #1f2937;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    overflow: hidden;
    position: relative;
}

.header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.header-avatar i {
    z-index: 1;
}

.header-text {
    text-align: center;
}

.header-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 5px;
}

.header-subtitle {
    font-size: 16px;
    color: var(--gray-600);
    font-weight: 500;
}

.header-icon-right {
    font-size: 40px;
    color: var(--whatsapp-green);
}

/* ===== GOOGLE AUTH ===== */
.google-auth {
    width: 100%;
    max-width: 600px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.google-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    color: var(--gray-700);
    border: 2px solid var(--gray-200);
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.google-btn:hover {
    border-color: var(--google-blue);
    transform: translateY(-2px);
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.user-info:hover {
    transform: scale(1.05);
}

.user-profile-pic {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid #10b981;
    object-fit: cover;
    box-shadow: var(--shadow-md);
}

/* ===== CARDS ===== */
.card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-xl);
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

/* ===== FORM ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
    font-size: 14px;
}

.label-hint {
    font-weight: 400;
    font-size: 12px;
    color: var(--gray-500);
    font-style: italic;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--whatsapp-green);
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

/* ===== TOGGLE BUTTONS ===== */
.toggle-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: white;
    color: var(--gray-600);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn:hover {
    border-color: var(--whatsapp-green);
    background: var(--gray-50);
}

.toggle-btn.active {
    border-color: var(--whatsapp-green);
    background: var(--whatsapp-green);
    color: white;
}

/* ===== TIME INPUT ===== */
.time-input-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.time-btn {
    padding: 8px 12px;
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    color: var(--gray-600);
    font-size: 13px;
    white-space: nowrap;
}

.time-btn:hover {
    border-color: var(--whatsapp-green);
    background: var(--gray-50);
}

.time-input {
    width: 100px;
    text-align: center;
    font-weight: 600;
}

/* ===== BUTTONS ===== */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 25px;
}

.btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: var(--shadow-md);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--whatsapp-green) 0%, var(--whatsapp-teal) 100%);
    color: white;
}

.btn-copy {
    padding: 8px 16px;
    background: var(--gray-100);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    color: var(--gray-700);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-copy:hover {
    background: var(--whatsapp-green);
    border-color: var(--whatsapp-green);
    color: white;
}

/* ===== PREVIEW & OUTPUT ===== */
.preview-card {
    background: var(--gray-50);
    border: 2px dashed var(--gray-300);
}

.message-preview {
    width: 100%;
    padding: 20px;
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    min-height: 150px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--gray-900);
    font-family: 'Inter', sans-serif;
    resize: vertical;
}

.message-preview:focus {
    outline: none;
    border-color: var(--whatsapp-green);
}

.message-output {
    padding: 20px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--whatsapp-green);
    font-size: 15px;
    line-height: 1.7;
    color: var(--gray-900);
    white-space: pre-wrap;
}

.placeholder-text {
    color: var(--gray-400);
    font-style: italic;
    text-align: center;
    padding: 20px 0;
}

/* ===== LAST MESSAGE INDICATOR ===== */
.last-message-indicator {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 12px;
    padding: 12px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #92400e;
}

/* ===== CRONOLOGIA ===== */
.cronologia-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cronologia-item {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 16px;
}

.cronologia-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.cronologia-message {
    color: var(--gray-700);
    line-height: 1.6;
    font-size: 14px;
}

/* ===== IMPORTANTE ===== */
.importante-card {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
}

.importante-text {
    font-size: 18px;
    color: #92400e;
    text-align: center;
    font-weight: 600;
    margin-bottom: 20px;
}

.iban-copy-group {
    display: flex;
    gap: 12px;
}

.iban-field {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray-600);
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
}

.variabili-help {
    margin-top: 10px;
    padding: 15px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.var-btn {
    padding: 6px 12px;
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.var-btn:hover {
    background: var(--whatsapp-green);
    color: white;
    border-color: var(--whatsapp-green);
}

/* ===== NOTIFICATION ===== */
.notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--whatsapp-green);
    color: white;
    padding: 16px 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    z-index: 3000;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.contact-info {
    margin-top: 15px;
    padding: 12px 16px;
    background: #e8f5e9;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--whatsapp-green);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--gray-700);
}

.contact-info.error {
    background: #ffebee;
    border-left-color: var(--google-red);
}

/* ===== CALENDAR VIEW ===== */
.calendar-days {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.calendar-day-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.calendar-day-header {
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    color: white;
    padding: 16px 20px;
}

.calendar-day-header h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    text-transform: capitalize;
}

.calendar-day-stats {
    display: flex;
    gap: 15px;
    font-size: 13px;
}

.stat-pending,
.stat-contacted {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.2);
    font-weight: 500;
}

.calendar-events-list {
    padding: 10px;
}

.calendar-event-item {
    display: grid;
    grid-template-columns: 80px 1fr 120px;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: var(--radius-md);
    background: var(--gray-50);
    transition: all 0.2s;
}

.calendar-event-item:hover {
    background: var(--gray-100);
    transform: translateX(2px);
}

.calendar-event-item.contacted {
    background: #e8f5e9;
    border-left: 3px solid var(--whatsapp-green);
}

.calendar-event-item.pending {
    background: #fff3e0;
    border-left: 3px solid #ff9800;
}

.event-time {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
}

.event-time i {
    color: var(--gray-500);
    margin-right: 4px;
}

.event-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-800);
}

.event-name i {
    color: var(--gray-500);
    margin-right: 6px;
}

.event-status {
    font-size: 12px;
    font-weight: 600;
    text-align: right;
}

.calendar-event-item.contacted .event-status {
    color: #2e7d32;
}

.calendar-event-item.pending .event-status {
    color: #f57c00;
}

.event-status i {
    margin-right: 4px;
}

.calendar-selection {
    padding: 15px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    font-size: 14px;
}

.btn-icon:hover {
    background: var(--gray-100);
    color: var(--bg-gradient-start);
    transform: rotate(180deg);
}

.card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    body {
        padding: 15px;
    }
    
    .toggle-group {
        grid-template-columns: 1fr;
    }
    
    .time-input-group {
        justify-content: center;
    }
    
    .calendar-event-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .event-status {
        text-align: left;
    }
}

/* ===== DATE PICKER ===== */
.date-picker {
    cursor: pointer;
    padding: 12px;
    font-size: 16px;
}

.date-picker::-webkit-calendar-picker-indicator {
    cursor: pointer;
    font-size: 18px;
}

