/**
 * Stili per Scrivania Pomodoro Frontend
 */

/* Container principale */
.scrivania-pomodoro-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Header del giorno */
.day-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.day-header .current-date {
    font-size: 2.5em;
    font-weight: 300;
    margin-bottom: 10px;
}

.day-header .day-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.day-header .stat-item {
    text-align: center;
}

.day-header .stat-number {
    font-size: 1.8em;
    font-weight: bold;
    display: block;
}

.day-header .stat-label {
    font-size: 0.9em;
    opacity: 0.9;
}

/* Timer Pomodoro */
.pomodoro-timer {
    background: white;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.pomodoro-timer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.timer-label {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.timer-display {
    font-size: 6em;
    font-weight: 300;
    font-family: 'Courier New', monospace;
    color: #333;
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.timer-display.break-mode {
    color: #28a745;
}

.timer-progress {
    height: 6px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 3px;
    transition: width 0.3s ease;
    margin: 20px 0;
}

.timer-controls {
    margin-top: 30px;
}

.timer-controls button {
    margin: 0 10px;
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timer-start {
    background: #28a745;
    color: white;
}

.timer-start:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.timer-pause {
    background: #ffc107;
    color: #212529;
}

.timer-pause:hover {
    background: #e0a800;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.timer-resume {
    background: #17a2b8;
    color: white;
}

.timer-resume:hover {
    background: #138496;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
}

.timer-stop {
    background: #dc3545;
    color: white;
}

.timer-stop:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

/* Form nuova sessione */
.new-session-form {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.new-session-form h3 {
    margin-top: 0;
    color: #333;
    font-size: 1.3em;
}

.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
    align-items: end;
}

.form-row input,
.form-row select {
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.form-row input:focus,
.form-row select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-row label {
    font-weight: 500;
    color: #555;
    margin-bottom: 5px;
    display: block;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.dashboard-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.dashboard-card h3 {
    margin-top: 0;
    color: #333;
    font-size: 1.4em;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

/* To-Do List */
.todo-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.todo-item {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.todo-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.todo-item.completed {
    opacity: 0.6;
    background: #d4edda;
    border-left-color: #28a745;
}

.todo-checkbox {
    margin-right: 15px;
    transform: scale(1.2);
}

.todo-content {
    flex: 1;
}

.todo-title {
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
}

.todo-meta {
    font-size: 0.85em;
    color: #666;
}

.todo-company {
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    margin-right: 8px;
}

.todo-project {
    background: #764ba2;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
}

.todo-priority {
    margin-left: auto;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 500;
    text-transform: uppercase;
}

.priority-urgent {
    background: #dc3545;
    color: white;
}

.priority-high {
    background: #fd7e14;
    color: white;
}

.priority-normal {
    background: #6c757d;
    color: white;
}

.priority-low {
    background: #6c757d;
    color: white;
    opacity: 0.7;
}

/* Note del giorno */
.notes-editor {
    margin-bottom: 20px;
}

.notes-editor textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.notes-editor textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.save-notes {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.save-notes:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.note-item {
    background: #f8f9fa;
    padding: 15px;
    margin: 15px 0;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.note-content {
    color: #333;
    line-height: 1.6;
}

.note-meta {
    font-size: 0.85em;
    color: #666;
    margin-top: 10px;
}

/* Sessioni del giorno */
.session-item {
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

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

.session-title {
    font-weight: 500;
    color: #333;
}

.session-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 500;
    text-transform: uppercase;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-running {
    background: #d1ecf1;
    color: #0c5460;
}

.status-paused {
    background: #fff3cd;
    color: #856404;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.session-details {
    font-size: 0.85em;
    color: #666;
}

.session-details span {
    margin-right: 15px;
}

/* Azioni rapide */
.quick-actions {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 4px solid #667eea;
}

.quick-actions h4 {
    margin-top: 0;
    color: #667eea;
    font-size: 1.2em;
}

.quick-todo-form {
    display: flex;
    gap: 10px;
    align-items: end;
}

.quick-todo-form input {
    flex: 1;
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 1em;
}

.quick-todo-form button {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.quick-todo-form button:hover {
    background: #218838;
    transform: translateY(-1px);
}

/* Navigazione temporale */
.date-navigation {
    text-align: center;
    margin: 30px 0;
}

.date-navigation .button {
    display: inline-block;
    margin: 0 10px;
    padding: 10px 20px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.date-navigation .button:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.date-navigation .current-date {
    display: inline-block;
    margin: 0 20px;
    font-size: 1.2em;
    font-weight: 500;
    color: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .scrivania-pomodoro-container {
        padding: 15px;
    }
    
    .day-header .current-date {
        font-size: 2em;
    }
    
    .day-header .day-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .pomodoro-timer {
        padding: 25px;
    }
    
    .timer-display {
        font-size: 4em;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .timer-controls button {
        display: block;
        width: 100%;
        margin: 10px 0;
    }
    
    .date-navigation .button {
        display: block;
        margin: 10px auto;
        width: 120px;
    }
}

@media (max-width: 480px) {
    .timer-display {
        font-size: 3em;
    }
    
    .pomodoro-timer {
        padding: 20px;
    }
    
    .dashboard-card {
        padding: 20px;
    }
}

/* Modalità scura */
@media (prefers-color-scheme: dark) {
    .scrivania-pomodoro-container {
        background: #1a1a1a;
        color: #e0e0e0;
    }
    
    .dashboard-card,
    .pomodoro-timer {
        background: #2d2d2d;
        color: #e0e0e0;
    }
    
    .todo-item,
    .session-item,
    .note-item {
        background: #3a3a3a;
    }
    
    .new-session-form {
        background: #3a3a3a;
    }
    
    .quick-actions {
        background: linear-gradient(135deg, #3a3a3a 0%, #2d2d2d 100%);
    }
    
    input, textarea, select {
        background: #2d2d2d;
        color: #e0e0e0;
        border-color: #555;
    }
}

/* Animazioni */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.dashboard-card {
    animation: fadeIn 0.6s ease-out;
}

.dashboard-card:nth-child(2) {
    animation-delay: 0.1s;
}

.dashboard-card:nth-child(3) {
    animation-delay: 0.2s;
}

.dashboard-card:nth-child(4) {
    animation-delay: 0.3s;
}

/* Stati di caricamento */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Controlli touch-friendly */
.touch-friendly {
    min-height: 44px;
    min-width: 44px;
}

/* Focus visibile per accessibilità */
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Scrollbar personalizzata */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}

