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

:root {
    --primary: #4a90d9;
    --primary-dark: #357abd;
    --success: #4caf50;
    --bg: #f5f7fa;
    --card: #ffffff;
    --text: #333333;
    --text-light: #666666;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 400px;
    background: var(--card);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 30px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

/* User Bar */
.user-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-light);
    text-align: left;
}

.user-email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 1rem;
}

.logout-btn {
    background: var(--bg);
    border: 1px solid #ddd;
    color: var(--text-light);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.logout-btn:hover {
    background: #e9ecef;
    color: var(--text);
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid #ddd;
}

.tab-nav a {
    padding: 0.75rem 1.5rem;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.95rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-nav a:hover {
    color: var(--text);
    background: rgba(0,0,0,0.03);
}

.tab-nav a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Loading Screen */
.loading-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    font-size: 1rem;
    color: var(--text-light);
}

/* Tab Content Panels */
.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Guide Styles */
.guide-section {
    background: var(--bg);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    text-align: left;
}

.guide-section h2 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    color: var(--primary);
}

.guide-section p {
    line-height: 1.6;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.guide-section ul, .guide-section ol {
    line-height: 1.7;
    padding-left: 1.25rem;
    font-size: 0.9rem;
}

.guide-section li {
    margin-bottom: 0.3rem;
}

.preset-explain {
    border-left: 3px solid var(--primary);
    padding-left: 0.75rem;
    margin: 0.75rem 0;
}

.preset-name {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95rem;
}

.why-box {
    background: rgba(74, 144, 217, 0.1);
    border-radius: 8px;
    padding: 0.75rem;
    margin: 0.75rem 0;
}

h1 {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.tagline {
    color: var(--text-light);
    font-size: 0.95rem;
    font-style: italic;
}

/* Toggle Button */
.toggle-section {
    text-align: center;
    margin-bottom: 30px;
}

.toggle-btn {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.toggle-btn.off {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.toggle-btn.on {
    background: linear-gradient(135deg, var(--success), #45a049);
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.toggle-btn:hover {
    transform: scale(1.05);
}

.toggle-btn:active {
    transform: scale(0.98);
}

.status {
    margin-top: 15px;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Settings */
.settings {
    background: var(--bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text);
}

.interval-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
}

#intervalValue {
    font-weight: 600;
    color: var(--primary);
    min-width: 20px;
}

textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 60px;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
}

select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: var(--primary);
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    vertical-align: middle;
}

/* Streak */
.streak-section {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #fff9e6, #fff3cc);
    border-radius: 12px;
    margin-bottom: 20px;
}

.streak-number {
    font-size: 3rem;
    font-weight: 700;
    color: #f5a623;
}

.streak-label {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Footer */
footer {
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
    font-style: italic;
}

/* Mobile adjustments */
@media (max-width: 420px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .toggle-btn {
        width: 100px;
        height: 100px;
        font-size: 1rem;
    }
}
