/**
 * style.css
 * Ver: 2.0 (Unified SVG Menu Button)
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #fffbf7;
    --bg-secondary: #fff8f0;
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #999;
    --border-color: #ffe8d1;
    --shadow: none; 
    --accent: #F39C12;
    --accent-dark: #E67E22;
    --accent-light: #FDB45C;
    --success: #F39C12;
    --danger: #E74C3C;
}

[data-theme="dark"] {
    --bg-primary: #1a1614;
    --bg-secondary: #2a2420;
    --text-primary: #e5e5e5;
    --text-secondary: #ccc;
    --text-muted: #999;
    --border-color: #3d3228;
    --shadow: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: all 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header & Logo */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 1rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.logo-link {
    text-decoration: none;
    color: inherit;
}

.header-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.header-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Buttons */
.btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
}

.btn:hover {
    background: var(--bg-secondary);
}

.btn.primary {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.btn.primary:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

/* Menu */
.menu-container {
    position: relative;
}

.menu-btn {
    background: none;
    /* [CHANGE] Added border to match other buttons */
    border: 1px solid var(--border-color);
    /* [CHANGE] Updated color to primary */
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-btn:hover {
    background: var(--bg-secondary);
}

.menu-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    min-width: 160px;
    z-index: 10;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    pointer-events: none;
    margin-top: 0.5rem;
}

.menu-dropdown.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.menu-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    text-align: left;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    text-decoration: none; 
}

.menu-item:hover {
    background: var(--bg-secondary);
}

.menu-item.danger {
    color: #E74C3C;
}

.language-picker {
    display: grid;
    gap: 0.35rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.language-picker label {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.language-picker select {
    width: 100%;
    min-height: 38px;
    padding: 0.4rem 0.55rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font: inherit;
    direction: ltr;
}

.language-picker select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Timer Cards */
.timers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.timer-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.timer-card.running {
    border-color: var(--accent);
    box-shadow: none;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(243, 156, 18, 0.05) 100%);
}

.timer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.timer-title {
    font-size: 1.125rem;
    font-weight: 400;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 60%;
    cursor: pointer;
}

.timer-actions {
    display: flex;
    gap: 0.5rem;
}

.timer-action {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.timer-action:hover {
    background: var(--bg-primary);
    color: var(--text-secondary);
}

.timer-display {
    font-size: 2.5rem;
    font-family: 'Courier New', monospace;
    font-weight: 300;
    margin-bottom: 1rem;
    letter-spacing: 1px;
    cursor: pointer;
    border: 1px dashed transparent;
    padding: 0.25rem;
    border-radius: 4px;
}

.timer-display:hover {
    border-color: var(--border-color);
}

.pay-toggle {
    display: flex;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.pay-btn {
    flex: 1;
    padding: 0.5rem;
    background: var(--bg-primary);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.pay-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pay-btn.active {
    background: var(--accent);
    color: #ffffff;
}

.rate-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.rate-input:focus {
    outline: none;
    border-color: var(--accent);
}

.rate-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.timer-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.timer-btn {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.timer-btn.primary {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.timer-btn.primary:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

.timer-btn:hover {
    opacity: 0.8;
}

.timer-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.timer-stats {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.stat-row {
    display: flex;
    justify-content: space-between;
}

.add-timer {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 3rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-muted);
}

.add-timer:hover {
    border-color: var(--text-muted);
    color: var(--text-secondary);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: none; 
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 500;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.time-input {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.time-input input {
    width: 60px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    text-align: center;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: none;
    z-index: 1001;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    min-width: 250px;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.success {
    border-color: var(--accent);
    background: rgba(243, 156, 18, 0.1);
    color: var(--accent-dark);
}

.notification.error {
    border-color: #E74C3C;
    background: rgba(231, 76, 60, 0.1);
    color: #E74C3C;
}

.shortcuts {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 1rem 0;
    text-align: center;
}

.footer {
    text-align: center;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

.footer a:hover {
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .header {
        flex-direction: row;
        gap: 1rem;
    }
    
    .timer-display {
        font-size: 2rem;
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* =========================================
   Download Page Styles
   ========================================= */

.download-container {
    padding: 2rem 0;
    max-width: 900px;
    margin: 0 auto;
}

.hero-section {
    text-align: center;
    margin-bottom: 3rem;
}

.hero-section h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 300;
}

.hero-section p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.download-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2.5rem 2rem;
    text-align: center;
    transition: transform 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: none;
}

.download-card:hover {
    transform: translateY(-5px);
    box-shadow: none;
    border-color: var(--accent);
}

.card-icon {
    margin-bottom: 1.5rem;
    color: var(--accent);
    background: var(--bg-primary);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}

.download-card h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.download-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    flex-grow: 1;
}

.platform-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.tag {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.block-btn {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding: 0.8rem;
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.version-info {
    font-size: 0.75rem !important;
    color: var(--text-muted) !important;
    margin-bottom: 0 !important;
}

@media (max-width: 768px) {
    .download-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   Calculator Page Styles
   ========================================= */

.calculator-container { 
    max-width: 600px; 
    margin: 0 auto; 
    padding: 2rem 0;
}

.tab-group { 
    display: flex; 
    gap: 1rem; 
    margin-bottom: 2rem; 
    justify-content: center; 
}

.tab-btn { 
    padding: 0.75rem 1.5rem; 
    border: 1px solid var(--border-color); 
    background: var(--bg-secondary); 
    color: var(--text-secondary); 
    border-radius: 2rem; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    font-size: 0.9rem; 
}

.tab-btn.active { 
    background: var(--accent); 
    color: white; 
    border-color: var(--accent); 
    box-shadow: none; 
}

.page-content { 
    display: none; 
    animation: fadeIn 0.3s ease; 
}

.page-content.active { 
    display: block; 
}

.calculator-card { 
    background: var(--bg-secondary); 
    border: 1px solid var(--border-color); 
    border-radius: 12px; 
    padding: 2rem; 
    box-shadow: none; 
}

.input-group { 
    margin-bottom: 1.25rem; 
}

.input-group label { 
    display: block; 
    margin-bottom: 0.5rem; 
    font-size: 0.85rem; 
    font-weight: 500; 
    color: var(--text-secondary); 
}

.input-group input { 
    width: 100%; 
    padding: 0.75rem; 
    border: 1px solid var(--border-color); 
    border-radius: 6px; 
    background: var(--bg-primary); 
    color: var(--text-primary); 
    font-size: 1rem; 
    transition: border-color 0.2s; 
}

.input-group input:focus { 
    outline: none; 
    border-color: var(--accent); 
}

.calculator-results { 
    margin-top: 2rem; 
    padding-top: 1.5rem; 
    border-top: 1px dashed var(--border-color); 
}

.result-row { 
    display: flex; 
    justify-content: space-between; 
    padding: 0.5rem 0; 
    font-size: 0.95rem; 
}

.result-row span:first-child { 
    color: var(--text-secondary); 
}

.result-row span:last-child { 
    font-weight: 600; 
    color: var(--text-primary); 
}

.calc-btn { 
    width: 100%; 
    margin-top: 1rem; 
    padding: 1rem; 
    font-size: 1rem; 
}

@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(5px); } 
    to { opacity: 1; transform: translateY(0); } 
}
