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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    min-height: 100vh;
    color: white;
}

.app-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: white;
}

.subtitle {
    font-size: 14px;
    opacity: 0.9;
    color: white;
}

/* Timer Section */
.timer-section {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.timer-display {
    text-align: center;
    font-size: 56px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
    margin-bottom: 24px;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.timer-display span {
    display: inline-block;
    min-width: 60px;
}

#milliseconds {
    font-size: 36px;
    opacity: 0.8;
}

.timer-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Topic Section */
.topic-section {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.topic-section h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    color: white;
}

/* Theme Selector */
.theme-selector {
    margin-bottom: 20px;
}

.theme-selector label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: white;
}

.theme-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-select:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.25);
}

.theme-select:focus {
    outline: none;
    border-color: white;
    background: rgba(255, 255, 255, 0.3);
}

.theme-select option {
    background: #059669;
    color: white;
}

/* Topic Card */
.topic-card {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.topic-text {
    font-size: 18px;
    font-weight: 500;
    line-height: 1.6;
    text-align: center;
    color: white;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: capitalize;
}

.btn-primary {
    background: white;
    color: #10b981;
    flex: 1;
}

.btn-primary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    flex: 1;
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
}

.btn-tertiary {
    background: rgba(239, 68, 68, 0.8);
    color: white;
    flex: 1;
}

.btn-tertiary:hover:not(:disabled) {
    background: rgba(239, 68, 68, 1);
}

.btn-block {
    width: 100%;
    padding: 14px 24px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn:active:not(:disabled) {
    transform: scale(0.98);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 30px;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error Message */
.error-msg {
    background: rgba(239, 68, 68, 0.9);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    margin-top: 16px;
    font-size: 14px;
    text-align: center;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 400px) {
    .app-container {
        padding: 12px;
    }

    .timer-display {
        font-size: 48px;
    }

    .timer-controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .topic-section,
    .timer-section {
        padding: 20px;
    }
}

