/* Reset e base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Ubuntu', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* Header */
.main-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.site-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.site-subtitle {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin: 0;
    font-weight: 400;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.clock-display {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    background: rgba(255, 255, 255, 0.8);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.control-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Main Content */
.main-content {
    padding: 2rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Tools Grid */
.tools-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.tool-category {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tool-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.category-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tools-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

/* Tool Buttons */
.tool-button {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    border-radius: 16px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    color: white;
    position: relative;
    overflow: hidden;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.tool-button:nth-child(2n) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.tool-button:nth-child(3n) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.tool-button:nth-child(4n) {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.tool-button:nth-child(5n) {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
}

.tool-button:nth-child(6n) {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: #333;
}

.tool-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tool-button:hover::before {
    opacity: 1;
}

.tool-button:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.tool-button:active {
    transform: translateY(-4px) scale(0.98);
}

.tool-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.tool-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    display: block;
}

.tool-desc {
    font-size: 0.9rem;
    opacity: 0.9;
    display: block;
    line-height: 1.4;
}

/* Accessibility Menu */
.accessibility-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 2000;
    display: none;
    max-width: 400px;
    width: 90%;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.panel-header h3 {
    color: #2c3e50;
    font-size: 1.3rem;
    margin: 0;
}

.panel-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.panel-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #2c3e50;
}

.accessibility-section {
    margin-bottom: 1.5rem;
}

.accessibility-section h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.font-size-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.font-size-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.font-size-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Widget Windows */
.widget-window {
    position: fixed;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: none;
    z-index: 1500;
    min-width: 400px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    animation: fadeInScale 0.3s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.window-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    border-radius: 20px 20px 0 0;
    position: relative;
}

.window-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 20px 20px 0 0;
    pointer-events: none;
}

.window-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    z-index: 1;
    position: relative;
}

.window-controls {
    display: flex;
    gap: 0.5rem;
    z-index: 1000;
    position: relative;
    pointer-events: auto;
}

.window-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    z-index: 1001;
    position: relative;
    pointer-events: auto;
}

.window-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.window-btn.close:hover {
    background: rgba(231, 76, 60, 0.8);
    border-color: rgba(231, 76, 60, 0.9);
}

.window-btn.minimize:hover {
    background: rgba(241, 196, 15, 0.8);
    border-color: rgba(241, 196, 15, 0.9);
}

.window-btn.maximize:hover {
    background: rgba(46, 204, 113, 0.8);
    border-color: rgba(46, 204, 113, 0.9);
}

.window-content {
    padding: 2rem;
    max-height: calc(90vh - 100px);
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.02);
}

/* Scrollbar personalizzata per i widget */
.window-content::-webkit-scrollbar {
    width: 8px;
}

.window-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.window-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

.window-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .site-title {
        font-size: 1.5rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .tool-category {
        padding: 1.5rem;
    }
    
    .tools-row {
        grid-template-columns: 1fr;
    }
    
    .tool-button {
        min-height: 100px;
        padding: 1.2rem;
    }
    
    .tool-icon {
        font-size: 2rem;
    }
    
    .tool-name {
        font-size: 1.1rem;
    }
    
    .widget-window {
        min-width: 95vw;
        max-width: 95vw;
        max-height: 85vh;
        top: 5vh !important;
        left: 2.5vw !important;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 1rem 0;
    }
    
    .tools-grid {
        gap: 1.5rem;
    }
    
    .tool-category {
        padding: 1rem;
    }
    
    .category-title {
        font-size: 1.2rem;
    }
    
    .tool-button {
        min-height: 90px;
        padding: 1rem;
    }
    
    .tool-icon {
        font-size: 1.8rem;
    }
    
    .tool-name {
        font-size: 1rem;
    }
    
    .tool-desc {
        font-size: 0.8rem;
    }
}

/* Night Mode */
body.night-mode {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

.night-mode .main-header {
    background: rgba(44, 62, 80, 0.95);
}

.night-mode .site-title,
.night-mode .clock-display {
    color: #ecf0f1;
}

.night-mode .site-subtitle {
    color: #bdc3c7;
}

.night-mode .tool-category {
    background: rgba(52, 73, 94, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.night-mode .category-title {
    color: #ecf0f1;
}

.night-mode .widget-window {
    background: rgba(44, 62, 80, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
}

.night-mode .window-header {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
}

.night-mode .window-header::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
}

.night-mode .window-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.night-mode .window-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.night-mode .window-content {
    color: #ecf0f1;
    background: rgba(255, 255, 255, 0.01);
}

.night-mode .window-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.night-mode .window-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
}

.night-mode .window-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #3e5771 0%, #34495e 100%);
}



.night-mode .template-text {
    background: var(--bg-secondary);
    border-color: #444;
}

/* Stili per elementi interni dei widget */
.widget-window input[type="text"],
.widget-window input[type="number"],
.widget-window input[type="email"],
.widget-window input[type="password"],
.widget-window textarea,
.widget-window select {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.widget-window input:focus,
.widget-window textarea:focus,
.widget-window select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.widget-window button:not(.window-btn) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.widget-window button:not(.window-btn):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.widget-window button:not(.window-btn):active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.widget-window .search-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1rem;
}

.widget-window .search-button {
    flex: 1;
    min-width: 120px;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
}

/* Stili specifici per modalità notturna */
.night-mode .widget-window input[type="text"],
.night-mode .widget-window input[type="number"],
.night-mode .widget-window input[type="email"],
.night-mode .widget-window input[type="password"],
.night-mode .widget-window textarea,
.night-mode .widget-window select {
    background: rgba(52, 73, 94, 0.8);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ecf0f1;
}

.night-mode .widget-window input:focus,
.night-mode .widget-window textarea:focus,
.night-mode .widget-window select:focus {
    border-color: #5a6fd8;
    box-shadow: 0 0 0 3px rgba(90, 111, 216, 0.2);
}

.night-mode .widget-window button:not(.window-btn) {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    box-shadow: 0 4px 15px rgba(52, 73, 94, 0.4);
}

.night-mode .widget-window button:not(.window-btn):hover {
    box-shadow: 0 6px 20px rgba(52, 73, 94, 0.5);
}

/* Stili specifici per il Calendario */
.calendar-container {
    padding: 1rem;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0.8rem 1rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.calendar-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
    flex: 1;
}

.nav-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 1.5rem;
    background: rgba(102, 126, 234, 0.1);
    padding: 2px;
    border-radius: 12px;
}

.day-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.8rem 0.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 8px;
}

.calendar-day {
    background: rgba(255, 255, 255, 0.9);
    padding: 0.8rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    position: relative;
}

.calendar-day:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: scale(1.05);
}

.calendar-day.today {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.calendar-day.has-event {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.calendar-day.has-event::after {
    content: '•';
    position: absolute;
    bottom: 4px;
    right: 6px;
    font-size: 1.2rem;
    color: #fff;
}

.event-section {
    background: rgba(102, 126, 234, 0.05);
    padding: 1.2rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.event-section h4 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
}

.event-section input {
    margin-bottom: 0.8rem;
}

.add-event-btn {
    width: 100%;
    margin-top: 0.5rem;
}

.events-list {
    background: rgba(118, 75, 162, 0.05);
    padding: 1.2rem;
    border-radius: 12px;
    border: 1px solid rgba(118, 75, 162, 0.1);
}

.events-list h4 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
}

.event-item {
    background: rgba(255, 255, 255, 0.8);
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.event-item:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.event-date {
    font-size: 0.85rem;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.event-title {
    font-weight: 500;
    color: #2c3e50;
}

/* Stili per modalità notturna del calendario */
.night-mode .calendar-header {
    background: rgba(52, 73, 94, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

.night-mode .calendar-header h3 {
    color: #ecf0f1;
}

.night-mode .nav-btn {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    box-shadow: 0 4px 12px rgba(52, 73, 94, 0.4);
}

.night-mode .calendar-grid {
    background: rgba(52, 73, 94, 0.2);
}

.night-mode .day-header {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
}

.night-mode .calendar-day {
    background: rgba(52, 73, 94, 0.6);
    color: #ecf0f1;
}

.night-mode .calendar-day:hover {
    background: rgba(52, 73, 94, 0.8);
}

.night-mode .calendar-day.today {
    background: linear-gradient(135deg, #5a6fd8 0%, #4a5568 100%);
}

.night-mode .event-section {
    background: rgba(52, 73, 94, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
}

.night-mode .event-section h4,
.night-mode .events-list h4 {
    color: #ecf0f1;
}

.night-mode .events-list {
    background: rgba(52, 73, 94, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
}

.night-mode .event-item {
    background: rgba(52, 73, 94, 0.4);
    border-left-color: #5a6fd8;
    color: #ecf0f1;
}

.night-mode .event-item:hover {
    background: rgba(52, 73, 94, 0.6);
}

.night-mode .event-date {
    color: #5a6fd8;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tool-category {
    animation: fadeInUp 0.6s ease forwards;
}

.tool-category:nth-child(2) { animation-delay: 0.1s; }
.tool-category:nth-child(3) { animation-delay: 0.2s; }
.tool-category:nth-child(4) { animation-delay: 0.3s; }
.tool-category:nth-child(5) { animation-delay: 0.4s; }
.tool-category:nth-child(6) { animation-delay: 0.5s; }

/* Scrollbar personalizzata */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Classe per forzare la chiusura dei widget */
.widget-hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    z-index: -1 !important;
}

/* Timer Widget Styles */
.timer-container {
    padding: 1rem;
    text-align: center;
}

.timer-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 4px;
}

.tab-btn {
    flex: 1;
    padding: 0.8rem 1rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.tab-btn:hover:not(.active) {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.timer-section {
    display: none;
}

.timer-section.active {
    display: block;
}

.time-display {
    margin: 2rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f0ff 100%);
    border-radius: 20px;
    border: 2px solid rgba(102, 126, 234, 0.1);
}

.time-display span {
    font-size: 3rem;
    font-weight: 700;
    color: #2c3e50;
    font-family: 'Courier New', monospace;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.time-inputs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 1.5rem 0;
}

.time-inputs input {
    width: 80px;
    padding: 0.8rem;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.9);
}

.time-inputs input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.time-inputs span {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

.timer-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 1.5rem 0;
}

.timer-controls .control-btn {
    width: auto;
    height: auto;
    border-radius: 12px;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    min-width: 120px;
}

.timer-controls .control-btn.start {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.timer-controls .control-btn.start:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.timer-controls .control-btn.pause {
    background: linear-gradient(135deg, #FF9800 0%, #f57c00 100%);
    color: white;
}

.timer-controls .control-btn.pause:hover {
    background: linear-gradient(135deg, #f57c00 0%, #ef6c00 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.timer-controls .control-btn.reset {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
}

.timer-controls .control-btn.reset:hover {
    background: linear-gradient(135deg, #d32f2f 0%, #c62828 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.timer-controls .control-btn.lap {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.timer-controls .control-btn.lap:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.laps-list {
    margin-top: 2rem;
    text-align: left;
}

.laps-list h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.lap-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    margin-bottom: 0.5rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.lap-item span:first-child {
    font-weight: 600;
    color: #667eea;
}

.lap-item span:last-child {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #2c3e50;
}

/* Night Mode Styles for Timer */
.night-mode .timer-tabs {
    background: rgba(255, 255, 255, 0.1);
}

.night-mode .tab-btn {
    color: #bbb;
}

.night-mode .tab-btn:hover:not(.active) {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.night-mode .time-display {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-color: rgba(102, 126, 234, 0.3);
}

.night-mode .time-display span {
    color: #ecf0f1;
}

.night-mode .time-inputs input {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
    color: #ecf0f1;
}

.night-mode .time-inputs span {
    color: #667eea;
}

.night-mode .laps-list h4 {
    color: #ecf0f1;
}

.night-mode .lap-item {
    background: rgba(102, 126, 234, 0.1);
    border-left-color: #667eea;
}

.night-mode .lap-item span:first-child {
    color: #667eea;
}

.night-mode .lap-item span:last-child {
    color: #ecf0f1;
}

/* Calculator Widget Styles - Android Layout */
.calculator {
    padding: 1rem;
    max-width: 320px;
    margin: 0 auto;
}

.calc-display {
    margin-bottom: 1rem;
}

.calc-display input {
    width: 100%;
    height: 80px;
    font-size: 2rem;
    text-align: right;
    padding: 0 1rem;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #2c3e50;
}

.calc-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.calc-btn {
    height: 60px;
    border: none;
    border-radius: 12px;
    font-size: 1.4rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Pulsanti numerici */
.calc-btn:not(.operator):not(.clear):not(.equals) {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #2c3e50;
}

.calc-btn:not(.operator):not(.clear):not(.equals):hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    transform: translateY(-1px);
}

.calc-btn:not(.operator):not(.clear):not(.equals):active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Pulsanti operatori */
.calc-btn.operator {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.calc-btn.operator:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-1px);
}

/* Pulsante Clear */
.calc-btn.clear {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
}

.calc-btn.clear:hover {
    background: linear-gradient(135deg, #ff5252 0%, #e53935 100%);
    transform: translateY(-1px);
}

/* Pulsante Equals */
.calc-btn.equals {
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
    color: white;
}

.calc-btn.equals:hover {
    background: linear-gradient(135deg, #40c057 0%, #37b24d 100%);
    transform: translateY(-1px);
}

/* Pulsante Zero (doppia larghezza) */
.calc-btn.zero {
    grid-column: span 2;
}

/* Night Mode per Calculator */
.night-mode .calc-display input {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
    color: #ecf0f1;
}

.night-mode .calc-btn:not(.operator):not(.clear):not(.equals) {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    color: #ecf0f1;
}

.night-mode .calc-btn:not(.operator):not(.clear):not(.equals):hover {
    background: linear-gradient(135deg, #3e5771 0%, #34495e 100%);
}