/* Araam - Shared Styles */

:root {
    /* Light theme */
    --primary-color: #E6E6FA;
    --secondary-color: #9DC183;
    --accent-color: #B0C4DE;
    --accent-color-2: #3492eb;
    --text-color: #333;
    --text-color-2: #c37515;
    --bg-color: #f5faf3;
    --modal-bg: rgba(0, 0, 0, 0.2);
    --tooltip-bg: white;
    --tooltip-shadow: rgba(0, 0, 0, 0.1);
    --modal-content-bg: white;
    --success: #9DC183;
    --warning: #ffa500;
    --error: #ff6b6b;
    --base-unit: 16px;
    --golden-ratio: 1.618;
    --transition-slow: 2000ms;
    --transition-medium: 400ms;
    --transition-fast: 200ms;
    --radius-sm: calc(var(--base-unit) * 0.5);
    --radius-md: calc(var(--base-unit) * 1);
    --radius-lg: calc(var(--base-unit) * 1.5);
    --radius-full: 50%;
    --font-serif: 'Spectral', serif;
    --font-sans: 'Inter', sans-serif;
    --shadow-primary: rgba(0, 0, 0, 0.1);
    --shadow-focus: rgba(157, 193, 131, 0.3);
    --gradient-focus: linear-gradient(135deg, var(--secondary-color) 0%, var(--accent-color-2) 100%);
    --circle-size: min(60vh, 60vw);
}

[data-theme="dark"] {
    --primary-color: #2A2A3C;
    --secondary-color: #5A7355;
    --accent-color: #445C77;
    --accent-color-2: #1C4D82;
    --text-color: #E1E1E1;
    --text-color-2: #c37515;
    --bg-color: #1d2432;
    --modal-bg: rgba(255, 255, 255, 0.1);
    --tooltip-bg: #2A2A2A;
    --tooltip-shadow: rgba(255, 255, 255, 0.05);
    --modal-content-bg: #2A2A2A;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color var(--transition-medium), color var(--transition-medium);
}

h1 {
    font-family: var(--font-serif);
    font-weight: 500;
    color: var(--text-color-2);
}

.view {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.35s ease-out;
}

.view[hidden] {
    display: none !important;
}

.view.view-entering {
    opacity: 0;
}

.view.view-visible {
    opacity: 1;
}

/* Shared control button */
.control-btn {
    position: relative;
    padding: calc(var(--base-unit) * 0.8);
    border: none;
    border-radius: var(--radius-full);
    background-color: var(--accent-color);
    color: var(--text-color);
    cursor: pointer;
    transition: all var(--transition-fast);
    opacity: 0.7;
    width: calc(var(--base-unit) * 3.5);
    height: calc(var(--base-unit) * 3.5);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 8px var(--shadow-primary);
}

.control-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(var(--base-unit) * -2.5);
    left: 50%;
    transform: translateX(-50%);
    background: var(--tooltip-bg);
    color: var(--text-color);
    padding: calc(var(--base-unit) * 0.4) calc(var(--base-unit) * 0.8);
    border-radius: var(--radius-sm);
    font-size: calc(var(--base-unit) * 0.8);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 4px var(--tooltip-shadow);
}

.control-btn:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-2px);
}

.control-btn:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.icon {
    width: calc(var(--base-unit) * 1.5);
    height: calc(var(--base-unit) * 1.5);
    fill: var(--text-color);
}

/* Global theme toggle */
.global-controls {
    position: fixed;
    top: calc(var(--base-unit) * 1.5);
    right: calc(var(--base-unit) * 1.5);
    z-index: 100;
    display: flex;
    gap: calc(var(--base-unit) * 0.5);
}

.theme-toggle .icon {
    transition: transform var(--transition-medium), fill var(--transition-medium);
}

.theme-toggle:hover .icon {
    transform: rotate(45deg);
}

[data-theme="dark"] .theme-toggle .icon {
    transform: rotate(-180deg);
}

[data-theme="dark"] .theme-toggle:hover .icon {
    transform: rotate(-135deg);
}

/* Back button */
.back-btn {
    position: fixed;
    top: calc(var(--base-unit) * 1.5);
    left: calc(var(--base-unit) * 1.5);
    z-index: 100;
    width: calc(var(--base-unit) * 3);
    height: calc(var(--base-unit) * 3);
    padding: 0;
    border: none;
    border-radius: var(--radius-full);
    background: var(--primary-color);
    color: var(--text-color);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: calc(var(--base-unit) * 1.2);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px var(--shadow-primary);
}

.back-btn:hover {
    opacity: 1;
    transform: translateX(-2px);
    background: var(--accent-color);
}

.back-btn svg {
    width: calc(var(--base-unit) * 1.2);
    height: calc(var(--base-unit) * 1.2);
    fill: var(--text-color);
}

/* Ambient background - shared across views */
.ambient-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    transition: all 1.5s ease-in-out;
}

.ambient-orb-1 {
    width: 400px; height: 400px;
    top: -100px; right: -100px;
    background: var(--secondary-color);
    animation: ambientFloat1 12s ease-in-out infinite;
}

.ambient-orb-2 {
    width: 300px; height: 300px;
    bottom: -50px; left: -50px;
    background: var(--primary-color);
    animation: ambientFloat2 15s ease-in-out infinite;
}

/* Mode-specific ambient shifts */
[data-active-mode="breathe"] .ambient-orb-1 { background: var(--secondary-color); opacity: 0.2; }
[data-active-mode="breathe"] .ambient-orb-2 { background: var(--accent-color); opacity: 0.15; }
[data-active-mode="focus"] .ambient-orb-1 { background: var(--accent-color-2); opacity: 0.1; }
[data-active-mode="focus"] .ambient-orb-2 { background: var(--secondary-color); opacity: 0.08; }

@keyframes ambientFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-30px, 20px) scale(1.1); }
    66% { transform: translate(20px, -15px) scale(0.95); }
}

@keyframes ambientFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(25px, -20px) scale(1.1); }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
