* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --secondary-color: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --background: #ffffff;
    --surface: #f9fafb;
    --border: #e5e7eb;
    --danger: #ef4444;
    --success: #10b981;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius: 0.75rem;
    --radius-sm: 0.5rem;
    --radius-lg: 1rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
    z-index: 2;
}

.header {
    padding: 2rem 0;
    text-align: center;
    color: white;
    position: relative;
}

.site-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.site-description {
    font-size: 1.125rem;
    opacity: 0.95;
}

.language-selector {
    position: absolute;
    top: 2rem;
    right: 0;
}

.language-selector select {
    padding: 0.5rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.875rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.language-selector select:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.language-selector select option {
    background: var(--primary-color);
    color: white;
}

.main-content {
    padding: 2rem 0 4rem;
}

.add-timer-section,
.timers-section {
    background: var(--background);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-xl);
}

.add-timer-section h2,
.timers-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.timer-form {
    display: grid;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="time"] {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--background);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.color-picker {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.color-picker input[type="color"] {
    width: 60px;
    height: 40px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-picker input[type="color"]:hover {
    transform: scale(1.05);
}

.preset-colors {
    display: flex;
    gap: 0.5rem;
}

.color-preset {
    width: 32px;
    height: 32px;
    border: 2px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-preset:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    color: white;
    box-shadow: var(--shadow-md);
}

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

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

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

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: var(--surface);
    color: var(--text-primary);
}

.timers-list {
    display: grid;
    gap: 1.5rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.timer-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--timer-color, var(--primary-color));
    transition: all 0.3s ease;
}

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

.timer-card.timer-finished {
    opacity: 0.7;
    background: linear-gradient(135deg, var(--surface), #fef2f2);
}

.timer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.timer-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.timer-actions {
    display: flex;
    gap: 0.25rem;
}

.timer-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--background);
    border-radius: var(--radius-sm);
}

.time-unit {
    text-align: center;
}

.time-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--timer-color, var(--primary-color));
    line-height: 1;
}

.time-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-top: 0.25rem;
}

.time-separator {
    font-size: 2rem;
    font-weight: 700;
    color: var(--timer-color, var(--primary-color));
    opacity: 0.5;
}

.timer-finished-message {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--danger);
    text-align: center;
    padding: 1rem;
}

.timer-target-date {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--background);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-content h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.share-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.share-url-input {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background: var(--surface);
    color: var(--text-primary);
}

.share-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.share-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.share-twitter {
    background: #1DA1F2;
}

.share-facebook {
    background: #1877F2;
}

.share-line {
    background: #00C300;
}

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

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--text-primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 2000;
}

.toast.show {
    transform: translateX(0);
}

.footer {
    text-align: center;
    padding: 2rem 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translate(-50%, -40%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

@media (min-width: 768px) {
    .timer-form {
        grid-template-columns: 1fr 1fr;
    }
    
    .form-group:first-child {
        grid-column: 1 / -1;
    }
    
    .checkbox-group {
        grid-column: 1 / -1;
    }
    
    .btn-primary {
        grid-column: 1 / -1;
        justify-self: start;
    }
    
    .timers-list {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

@media (max-width: 640px) {
    .site-title {
        font-size: 1.875rem;
    }
    
    .language-selector {
        position: static;
        margin-top: 1rem;
    }
    
    .add-timer-section,
    .timers-section {
        padding: 1.5rem;
    }
    
    .timer-display {
        gap: 0.5rem;
    }
    
    .time-value {
        font-size: 1.5rem;
    }
    
    .time-separator {
        font-size: 1.5rem;
    }
    
    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        transform: translateY(100px);
    }
    
    .toast.show {
        transform: translateY(0);
    }
}