/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    line-height: 1.5;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* Container */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.language-selector {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.language-selector:hover {
    background: white;
}

.language-selector:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

.header__title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header__subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Main Content */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Timer Section */
.timer {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.timer__display {
    margin-bottom: 30px;
}

.timer__time {
    font-size: 3rem;
    font-weight: 700;
    color: #2196F3;
    font-variant-numeric: tabular-nums;
    display: block;
}

.timer__button {
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 20px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
    margin-bottom: 20px;
}

.timer__button:hover {
    background: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.4);
}

.timer__button:active {
    transform: translateY(0);
}

.timer__button--active {
    background: #f44336;
}

.timer__button--active:hover {
    background: #d32f2f;
    box-shadow: 0 5px 15px rgba(244, 67, 54, 0.4);
}

.timer__status {
    color: #666;
    font-size: 1rem;
    font-style: italic;
}

/* History Section */
.history {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.history__title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.history__list {
    margin-bottom: 20px;
}

.history__empty {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 40px 20px;
}

.contraction-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    border-left: 4px solid #2196F3;
    position: relative;
}

.contraction-item__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.contraction-item__content {
    flex: 1;
}

.contraction-item__time {
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.contraction-item__duration {
    color: #2196F3;
    font-weight: 600;
    margin-left: 10px;
}

.contraction-item__frequency {
    color: #666;
    font-size: 0.9rem;
    margin-top: 4px;
}

.contraction-item__edit-btn {
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-left: 8px;
}

.contraction-item__edit-btn:hover {
    background: #1976D2;
}

.contraction-item__edit-form {
    margin-top: 8px;
}

.contraction-item__edit-row {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    align-items: center;
}

.contraction-item__edit-field {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.contraction-item__edit-label {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 2px;
}

.contraction-item__edit-input {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 0.9rem;
}

.contraction-item__edit-input:focus {
    outline: none;
    border-color: #2196F3;
}

.contraction-item__edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.contraction-item__save-btn {
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.contraction-item__save-btn:hover {
    background: #45a049;
}

.contraction-item__cancel-btn {
    background: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.contraction-item__cancel-btn:hover {
    background: #d32f2f;
}

.history__actions {
    text-align: center;
}

.history__clear {
    background: #ff5722;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history__clear:hover {
    background: #e64a19;
    transform: translateY(-1px);
}

.history__clear:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Footer */
.footer {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
    color: white;
}

.footer__disclaimer {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.footer__privacy {
    font-size: 0.9rem;
    opacity: 0.8;
}

.footer__language {
    margin-top: 16px;
    text-align: center;
}

/* Utility Classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Animations */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(244, 67, 54, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0);
    }
}

.timer__button--active {
    animation: pulse 2s infinite;
}