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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 60px 50px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    animation: fadeIn 0.5s ease-in;
}

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

.title {
    font-size: 2.5rem;
    color: #333;
    text-align: center;
    margin-bottom: 40px;
    font-weight: 700;
}

.input-group {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    margin-bottom: 40px;
}

.date-input-wrapper {
    flex: 1;
    position: relative;
}

.date-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.1rem;
    border: 2px solid #ddd;
    border-radius: 12px;
    transition: all 0.3s ease;
    outline: none;
}

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

.date-input.error {
    border-color: #e74c3c;
    background-color: #ffe6e6;
}

.date-input.error:focus {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.error-message {
    display: none;
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 8px;
    position: absolute;
    left: 5px;
}

.date-input.error ~ .error-message {
    display: block;
}

.check-button {
    padding: 15px 35px;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.check-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.check-button:active {
    transform: translateY(0);
}

/* История */
.history-section {
    display: none;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.history-title {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 10px;
}

.history-list::-webkit-scrollbar {
    width: 8px;
}

.history-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f9f9f9;
    border-radius: 10px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

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

.history-value {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.history-time {
    color: #888;
    font-size: 0.85rem;
}

.clear-history {
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    background: #e74c3c;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-history:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

.clear-history:active {
    transform: translateY(0);
}

/* Попап */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeInOverlay 0.3s ease;
}

.popup-overlay.active {
    display: flex;
}

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

.popup {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.popup-content {
    text-align: center;
}

.popup-text {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 30px;
}

.popup-text.weekend {
    color: #27ae60;
}

.popup-text.workday {
    color: #e74c3c;
}

.popup-close {
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.popup-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* Адаптивность */
@media (max-width: 600px) {
    .container {
        padding: 40px 30px;
    }

    .title {
        font-size: 2rem;
    }

    .input-group {
        flex-direction: column;
    }

    .check-button {
        width: 100%;
    }
    
    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .history-time {
        font-size: 0.8rem;
    }
}
