/* ==========================================================================
   The Unchanging Principles of Muhurto
   This stylesheet is guided by the laws defined in AGENTS.MD.
   ========================================================================== */

/* --------------------------------------------------------------------------
   SECTION 1: THE LAWS OF SENSATION (The Vibe)
   -------------------------------------------------------------------------- */

body {
    /* Law 1: The Law of the Quiet Canvas */
    background-color: #0D0D0D;
    color: #EAEAEA;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#breathing-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Law 3: The Law of the Gentle Guide (Spaciousness) */
    justify-content: space-between;
    text-align: center;
    height: 80vh;
    padding: 2rem;
}

#instruction-text {
    /* Law 3: The Law of the Gentle Guide (Clarity Above All) */
    font-size: 2.5rem;
    font-weight: 300;
    margin: 0;
    text-shadow: 0 0 5px rgba(0, 246, 246, 0.7), 0 0 10px rgba(0, 246, 246, 0.5);
    letter-spacing: 0.5px;
}

#breathing-circle {
    width: 200px;
    height: 200px;
    border: 4px solid #00F6F6; /* Primary accent color */
    border-radius: 50%;
    background-color: transparent;
    /* Law 2: The Law of Organic Motion */
    transition: transform 4s ease-in-out, box-shadow 4s ease-in-out;
    box-shadow: 0 0 10px #00F6F6, 0 0 20px #00F6F6;
}

.growing {
    transform: scale(1.5);
}

#cycle-counter {
    font-size: 1.2rem;
    font-weight: 400;
    margin: 0;
}

#controls {
    display: flex;
    /* Law 3: The Law of the Gentle Guide (Spaciousness) */
    gap: 2rem;
}

#controls button {
    background: none;
    border: none;
    color: #00F6F6; /* Primary accent color */
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    /* Law 2: The Law of Organic Motion */
    transition: color 0.3s ease-in-out, text-shadow 0.3s ease-in-out, transform 0.1s ease-in-out;
}

#controls button:hover {
    color: #EAEAEA;
    text-shadow: 0 0 5px #00F6F6, 0 0 10px #00F6F6; /* Enhanced glow for feedback */
}

/* --------------------------------------------------------------------------
   SECTION 2: THE LAW OF THE SINGLE SPACE (Modal Panels)
   -------------------------------------------------------------------------- */

.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* Prevent interaction when hidden */
}

#settings-screen,
#ai-chat-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Dark, transparent overlay */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    /* Law 2: The Law of Organic Motion */
    transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
}

#settings-panel,
#ai-chat-panel {
    background-color: #1a1a1a; /* Slightly lighter than main background */
    padding: 2rem 3rem;
    border-radius: 15px;
    border: 1px solid #00F6F6;
    width: 90%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    /* Law 3: The Law of the Gentle Guide (Spaciousness) */
    gap: 1.5rem;
}

#settings-panel h2,
#ai-chat-panel h2 {
    color: #00F6F6;
    text-align: center;
    margin-top: 0;
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
}

.setting-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.control-button {
    background: none;
    border: 1px solid #00F6F6;
    color: #00F6F6;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Law 2: The Law of Organic Motion */
    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out, transform 0.1s ease-in-out;
}

.control-button:hover {
    background-color: #00F6F6;
    color: #0D0D0D;
}

.toggle-button {
    background-color: transparent;
    border: 1px solid #00F6F6;
    color: #00F6F6;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border-radius: 5px;
    cursor: pointer;
    /* Law 2: The Law of Organic Motion */
    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out, transform 0.1s ease-in-out;
    min-width: 60px; /* Ensure 'On' and 'Off' have same width */
    text-align: center;
}

.toggle-button.active {
    background-color: #00F6F6;
    color: #0D0D0D;
    font-weight: bold;
    box-shadow: 0 0 5px #00F6F6, 0 0 10px #00F6F6;
}

.setting-value {
    font-size: 1.2rem;
    font-weight: bold;
    min-width: 50px;
    text-align: center;
}

#theme-switcher {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

#theme-switcher button,
#close-settings-button,
#send-to-ai-button,
#close-ai-button,
.apply-rhythm-button {
    background-color: transparent;
    border: 1px solid #00F6F6;
    color: #00F6F6;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 5px;
    cursor: pointer;
    /* Law 2: The Law of Organic Motion */
    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out, transform 0.1s ease-in-out;
    white-space: nowrap;
}

#theme-switcher button:hover,
#close-settings-button:hover,
#send-to-ai-button:hover,
#close-ai-button:hover,
.apply-rhythm-button:hover {
    background-color: #00F6F6;
    color: #0D0D0D;
}

/* Universal subtle feedback for all interactive elements */
#controls button:active,
.control-button:active,
.toggle-button:active,
#theme-switcher button:active,
#close-settings-button:active,
#send-to-ai-button:active,
#close-ai-button:active,
.apply-rhythm-button:active {
    transform: scale(0.97);
}


/* --------------------------------------------------------------------------
   SECTION 3: THE LAW OF THE ORACLE (AI Chat Panel)
   -------------------------------------------------------------------------- */

#ai-chat-panel {
    text-align: center;
}

#ai-response-area {
    min-height: 100px;
    border: 1px dashed rgba(0, 246, 246, 0.3);
    border-radius: 10px;
    padding: 1rem;
    font-size: 1.1rem;
    line-height: 1.6;
    display: flex;
    flex-direction: column; /* Stack text and button vertically */
    justify-content: center;
    align-items: center;
}

#ai-response-area p {
    margin: 0;
}

#ai-response-area .ai-recommendation-text {
    font-style: italic;
    margin-bottom: 1rem;
}

#ai-input-container {
    display: flex;
    gap: 0.5rem;
}

#ai-prompt-input {
    flex-grow: 1;
    background-color: #0D0D0D;
    border: 1px solid #00F6F6;
    color: #EAEAEA;
    padding: 0.75rem;
    font-size: 1rem;
    border-radius: 5px;
}

#ai-prompt-input::placeholder {
    color: #888;
}

/* --------------------------------------------------------------------------
   Light Theme Override
   This section cleanly overrides the default dark theme styles.
   -------------------------------------------------------------------------- */

body.light-theme {
    background-color: #EAEAEA;
    color: #0D0D0D;
}

.light-theme #breathing-circle {
    border-color: #0D0D0D;
    box-shadow: none; /* Remove glow on light theme for better contrast */
}

.light-theme #instruction-text {
    text-shadow: none;
}

.light-theme #controls button {
    color: #0D0D0D;
}

.light-theme #settings-panel,
.light-theme #ai-chat-panel {
    background-color: #f5f5f5;
    border-color: #0D0D0D;
}

.light-theme #settings-panel h2,
.light-theme #ai-chat-panel h2,
.light-theme .control-button,
.light-theme .toggle-button,
.light-theme #theme-switcher button,
.light-theme #close-settings-button,
.light-theme #send-to-ai-button,
.light-theme #close-ai-button,
.light-theme .apply-rhythm-button {
    color: #0D0D0D;
    border-color: #0D0D0D;
}

.light-theme .toggle-button.active {
    background-color: #0D0D0D;
    color: #EAEAEA;
    box-shadow: none;
}

.light-theme .control-button:hover,
.light-theme .toggle-button:hover,
.light-theme #theme-switcher button:hover,
.light-theme #close-settings-button:hover,
.light-theme #send-to-ai-button:hover,
.light-theme #close-ai-button:hover,
.light-theme .apply-rhythm-button:hover {
    background-color: #0D0D0D;
    color: #EAEAEA;
}

.light-theme #ai-prompt-input {
    background-color: #EAEAEA;
    border-color: #0D0D0D;
    color: #0D0D0D;
}

.light-theme #ai-prompt-input::placeholder {
    color: #555;
}
