/* Importing the Montserrat font */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');

* {
    box-sizing: border-box;
}

:root {
    --background-color: #f5f7fa;
    --text-color: #333;
    --subtext-color: #555;
    --overlay-color: rgba(0, 0, 0, 0.5);
    --modal-background: #fff;
    --button-background: #e0e0e0;
    --button-hover: #d5d5d5;
    --half-opacity-text-color: rgba(0, 0, 0, 0.5);
}

body.dark-theme {
    --background-color: #2c3e50;
    --text-color: #ecf0f1;
    --subtext-color: #bdc3c7;
    --overlay-color: rgba(255, 255, 255, 0.2);
    --modal-background: #34495e;
    --button-background: #555;
    --button-hover: #666;
    --half-opacity-text-color: rgba(255, 255, 255, 0.5);
}

body {
    margin: 0;
    padding: 0;
    background: var(--background-color);
    font-family: 'Montserrat', sans-serif;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.5s ease, color 0.5s ease;
}

.clock-container {
    background: rgba(255, 255, 255, 0.85);
    padding: 40px 60px; /* Restored from 32px 48px */
    border-radius: 15px;
    /* box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); */
    text-align: center;
    max-width: 1000px; /* Restored from 800px */
    width: 90%;
    animation: fadeIn 1s ease-in-out;
    transition: background 0.5s ease, color 0.5s ease;
}

body.dark-theme .clock-container {
    background: rgba(44, 62, 80, 0.85);
    color: var(--text-color);
}

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

.scripture-info {
    margin: 0;
    font-size: 1.5em; /* Restored from 1.2em */
    color: var(--text-color);
    transition: opacity 0.3s ease, color 0.5s ease;
}

.time-display {
    margin: 20px 0;
    font-size: 5em; /* Restored from 4em */
    color: var(--text-color);
    opacity: 0.9;
    transition: opacity 0.3s ease, color 0.5s ease;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
}

#current-time {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    font-size: 3em; /* Restored from 2.4em */
}

.scripture-text {
    max-width: 90%;
    margin: 20px auto 0;
    text-align: center;
    font-size: 2em; /* Restored from 1.6em */
    color: var(--subtext-color);
    line-height: 1.6;
    opacity: 0.85;
    transition: opacity 0.3s ease, color 0.5s ease;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
}

.verse-number {
    opacity: 0.5;
    margin-right: 10px;
    /* display at the top */
    align-self: flex-start;
}

/* Options Button */
#options-button {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--button-background);
    border: none;
    border-radius: 50%;
    width: 50px; /* Restored from 40px */
    height: 50px; /* Restored from 40px */
    cursor: pointer;
    font-size: 1.2em; /* Restored from 1em */
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, color 0.5s ease;
    z-index: 1000;
}

#options-button:hover {
    background: var(--button-hover);
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: var(--overlay-color);
    transition: background 0.5s ease;
}

body.dark-theme .modal {
    background: rgba(255, 255, 255, 0.2);
}

.modal-content {
    background: var(--modal-background);
    margin: 10% auto;
    padding: 20px 30px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 10px;
    color: var(--text-color);
    transition: background 0.5s ease, color 0.5s ease;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: #000;
    text-decoration: none;
}

.modal-content h2 {
    margin-top: 0;
    text-align: center;
}

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

.setting-section h3 {
    margin-bottom: 10px;
}

.setting-section label {
    display: block;
    margin-bottom: 10px;
    cursor: pointer;
}

.setting-section input[type="radio"],
.setting-section input[type="checkbox"] {
    margin-right: 10px;
}

#save-settings {
    display: block;
    width: 100%;
    padding: 10px;
    background: #2ecc71;
    border: none;
    border-radius: 5px;
    color: white;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.3s ease;
}

#save-settings:hover {
    background: #27ae60;
}

/* Collections Container */
#collections-container {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 5px;
    background: var(--background-color);
}

body.dark-theme #collections-container {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #555;
}

/* Additional Styles for Collections and Books */
.collection {
    margin-bottom: 10px;
}

.books-container {
    margin-left: 20px;
    margin-top: 5px;
}

.books-container label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9em;
}

/* Responsive Design */
@media (max-width: 900px) {
    .clock-container {
        padding: 16px 24px; /* Reduced from 20px 30px */
    }

    .time-display {
        font-size: 3em; /* Restored from 2.4em */
    }

    .scripture-info h2 {
        font-size: 1em; /* Reduced from 1.2em */
    }

    #options-button, #refresh-button {
        width: 40px; /* Restored from 32px */
        height: 40px; /* Restored from 32px */
        font-size: 1.2em; /* Restored from 1em */
    }
}

/* Add this to your existing CSS file */

#refresh-button {
    position: fixed;
    top: 20px;
    right: 80px; /* Position it to the left of the options button */
    background: var(--button-background);
    border: none;
    border-radius: 50%;
    width: 40px; /* Restored from 32px */
    height: 40px; /* Restored from 32px */
    cursor: pointer;
    font-size: 1.2em; /* Restored from 1em */
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, color 0.5s ease;
    z-index: 1000;
}

#refresh-button:hover {
    background: var(--button-hover);
}

/* Transition effects for scripture text and reference */
#scripture-text, #scripture-reference {
    opacity: 0.2;
    transition: opacity 0.5s ease;
}

#scripture-text {
    transition-delay: 0.3s; /* This creates the overlap effect */
}

#scripture-reference {
    font-size: 1.2em; /* Reduced from 1.5em */
    color: var(--half-opacity-text-color);
}

.ampm {
    font-size: 0.5em; /* Restored from 0.4em */
    color: var(--half-opacity-text-color);
    /* show at bottom of container */
    align-self: flex-end;
    padding-bottom: 4%;
    margin-left: 10px;
}