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

:root {
    --dark-blue: #0f172a;
    --powder-blue: #60a5fa;
    --powder-blue-dark: #2084ff;
    --light-blue: #8eb7e0;
    --slate: #94a3b8;
    --glassmorphism: rgba(255, 255, 255, 0.05);
    --glassmorphism-border: rgba(255, 255, 255, 0.1);
    --glassmorphism-shadow: rgba(0, 0, 0, 0.2);
    --modal-overlay: rgba(0, 0, 0, 0.6);
    --modal-bg: #141e35;
    --icon-bg: #2d3b4f;
    --card-bg: #334155;
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --button-bg: #7da0fa;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background-color: var(--dark-blue);
    color: #f8fafc;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.container {
    display: grid;
    grid-template-areas: "header" "main-content" "shortcuts-section";
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px;
    align-items: center;
    padding: 1rem 2rem;
}

a {
    text-decoration: none;
}

/* custom alert */
.custom-alert {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(40, 40, 90, 0.95);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 15px;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.custom-alert.fade-out {
    opacity: 0;
    transform: translateY(-50%, -20p);
}


/* ----- Section 1: Header ----- */
.container .header-section {
    grid-area: header;
    width: full;
    position: fixed;
    top: 1rem;
    z-index: 100;
    margin-top: 1rem;
}

.header-section .todo-btn {
    position: fixed;
    top: 1.5rem;
    left: 2rem;
    z-index: 100;
    background-color: var(--icon-bg);
    color: var(--powder-blue);
    border: none;
    border-radius: 20%;
    padding: 0.4rem 0.5rem;
    cursor: pointer;
    font-size: 1.5rem;
    box-shadow: 0 0 8px var(--glassmorphism-shadow);
}

.header-section .pomodoro-toggle {
    position: fixed;
    top: 1.5rem;
    right: 2rem;
    z-index: 100;
    background-color: var(--icon-bg);
    color: var(--powder-blue);
    border: none;
    border-radius: 20%;
    padding: 0.4rem 0.5rem;
    cursor: pointer;
    font-size: 1.5rem;
    box-shadow: 0 0 8px var(--glassmorphism-shadow);
}

.header-section .todo-btn:hover::after {
    content: attr(title);
    position: absolute;
    left: -1rem;
    bottom: -1.8rem;
    background-color: #1e293b;
    color: #f1f5f9;
    padding: 4px 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    border-radius: 5px;
    box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.3);
    opacity: 1;
    transform: translateY(5px);
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 200;
}

.header-section .pomodoro-toggle:hover::after {
    content: attr(title);
    position: absolute;
    right: -1rem;
    bottom: -1.8rem;
    background-color: #1e293b;
    color: #f1f5f9;
    padding: 4px 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    border-radius: 5px;
    box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.3);
    opacity: 1;
    transform: translateY(5px);
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 200;
}

/* ----- Section 2: Main Content ----- */
.container .main-content {
    grid-area: main-content;
    width: full;
    display: flex;
    justify-content: space-evenly;
    justify-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* -- Left Section -- */
.main-content .left-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.left-section #lifeClock {
    border-radius: 50%;
    background-color: transparent;
}

.left-section .reset-btn-wrapper {
    text-align: center;
}

.left-section .reset-btn-wrapper .reset-btn {
    padding: 0.6rem 1.2rem;
    background: var(--glassmorphism);
    border: 1px solid var(--glassmorphism-border);
    border-radius: 12px;
    color: #cbd5e1;
    font-weight: 500;
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 10px var(--glassmorphism-shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.left-section .time-left {
    font-size: 1rem;
    font-weight: 500;
    color: var(--powder-blue);
    text-align: center;
}

.reset-btn:hover {
    background: var(--glassmorphism-border);
    color: #ffffff;
    transform: translateY(-2px);
}

.left-section .legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    font-size: 0.85rem;
    margin-top: 10px;
}

.left-section .legend p {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--slate);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.left-section .quote-card {
    font-style: italic;
    font-weight: 400;
    text-align: center;
    background: var(--glassmorphism);
    padding: 01rem 1.5rem;
    border-radius: 30px;
    color: #cbd5e1;
    box-shadow: inset 0 1px 3px var(--glassmorphism);
}

.quote-card i {
    font-size: 1rem;
    color: var(--light-blue);
}

.quote-card .quote-text {
    font-style: italic;
    font-size: 1.2rem;
    line-height: 1.4;
    color: #f8fafc;
}


/* -- Right Section -- */
.main-content .right-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.right-section .datetime-weather {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.time-display,
.location-icon,
.temperature-icon {
    background: var(--glassmorphism);
    border: 1px solid var(--glassmorphism-border);
    border-radius: 20px;
    padding: 1rem 1.5rem;
    backdrop-filter: blur(6px);
    color: var(--light-blue);
    box-shadow: 0 4px 12px var(--glassmorphism-shadow);
}

.right-section .datetime-weather .time-display h3 {
    font-size: 3rem;
    color: var(--powder-blue);
}

.right-section .datetime-weather .time-display p {
    font-size: 1.2rem;
    color: var(--slate);
    margin-top: 0.2rem;
    font-weight: 500;
}

.right-section .datetime-weather .weather-widget {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
}

.weather-widget .location-icon,
.weather-widget .temperature-icon {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}

.search-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: flex-end;
}

.search-dropdown-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--slate);
}

.search-engine-dropdown {
    padding: 0.3rem 0.7rem;
    background-color: #0f172a;
    color: #e2e8f0;
    border: 1.5px solid var(--powder-blue);
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.search-engine-dropdown:hover,
.search-engine-dropdown:focus {
    background-color: #1e293b;
    border-color: var(--light-blue)
}

.right-section .search-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--glassmorphism);
    border: 1px solid var(--glassmorphism-border);
    border-radius: 40px;
    padding: 0.4rem 0.5rem 0.4rem 1rem;
    backdrop-filter: blur(6px);
    box-shadow: 0 2px 6px var(--glassmorphism-shadow);
    transition: all 0.3s ease;
    margin-top: 1rem;
    max-width: 100%;
}

.right-section .search-bar input.input {
    background: transparent;
    border: none;
    outline: none;
    color: #e2e8f0;
    font-size: 1rem;
    width: 80%;
    padding: 0.5rem 0;
    flex: 1;
}

.right-section .search-bar input.input::placeholder {
    color: var(--slate);
}

.right-section .search-bar .search-btn {
    background-color: var(--powder-blue);
    border: none;
    border-radius: 50%;
    padding: 0.1rem;
    color: var(--dark-blue);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.right-section .search-bar .search-btn i {
    font-size: 1.3rem;
    color: whitesmoke;
    border-radius: 50%;
    padding: 6px;
    transition: background-color 0.3s ease;
    background-size: cover;
}

.right-section .search-bar .search-btn:hover {
    background-color: var(--powder-blue-dark);
}

/* ----- Section 3: shortcuts ----- */
.shortcuts-section {
    grid-area: shortcuts-section;
    position: fixed;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: transparent;
    z-index: 100;
    width: 80%;
    max-width: 1200px;
    padding: 0 1rem;
}

.shortcuts-section .shortcuts-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.shortcuts-container .shortcut-icon {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease;
    text-align: center;
    margin-top: 1rem;
    cursor: pointer;
}

.shortcuts-container .shortcut-icon:hover {
    transform: translateY(-5px);
}

/* Tooltip styling */
.shortcuts-container .shortcut-icon:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -1.8rem;
    background-color: #1e293b;
    color: #f1f5f9;
    padding: 4px 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    border-radius: 5px;
    box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.3);
    opacity: 1;
    transform: translateY(5px);
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 200;
}

.shortcuts-container .shortcut-icon::after {
    content: '';
    opacity: 0;
}

.shortcuts-container .shortcut-icon i {
    font-size: 1.5rem;
    color: var(--powder-blue);
    text-decoration: none;
    border-radius: 50%;
    background-color: var(--icon-bg);
    padding: 10px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ----- Goal Year Modal ----- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay .modal {
    background: var(--modal-bg);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    max-width: 300px;
    width: 80%;
}

.modal-overlay .modal input {
    margin-top: 1rem;
    padding: 0.5rem;
    width: 100%;
    border-radius: 10px;
}

.modal-overlay .modal button {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background-color: var(--powder-blue);
    color: var(--dark-blue);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

#goalModal.fade-in {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
    display: flex;
}

#goalModal.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* ----- To-Do List Floating Panel ----- */
.todo-panel {
    position: absolute;
    top: 4.5rem;
    left: 2rem;
    width: 300px;
    background-color: var(--modal-bg);
    border-radius: 1.5rem;
    padding: 1rem;
    z-index: 99;
    box-shadow: 0 4px 20px var(--glassmorphism-shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--glassmorphism-border);
}

.hidden {
    display: none;
}

.todo-panel h3 {
    font-size: 1.2rem;
    margin-top: 0.5rem;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
    text-align: center;
}

.todo-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--card-bg);
    padding: 0.4rem;
    border-radius: 2rem;
}

#todoInput {
    flex: 1;
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 1rem;
    background: transparent;
    outline: none;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

#todoForm button {
    background-color: var(--powder-blue);
    color: white;
    border: none;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.3s;
}

#todoForm button:hover {
    background-color: var(--powder-blue-dark);
}

#todoList li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--card-bg);
    border-radius: 1rem;
    padding: 0.6rem 1rem;
    margin-bottom: 0.6rem;
    margin-top: 0.6rem;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    cursor: pointer;
}

.todo-radio {
    appearance: none;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--light-blue);
    border-radius: 50%;
    display: inline-block;
    margin-right: 10px;
    position: relative;
    cursor: pointer;
}

.todo-text {
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: all 0.3s;
}

.todo-radio:checked::before {
    content: "";
    width: 8px;
    height: 8px;
    background-color: var(--powder-blue);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.todo-text.completed {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.delete-task {
    color: var(--light-blue);
    font-size: 1rem;
    cursor: pointer;
}

/* Pomodoro Timer Panel */
.pomodoro-panel {
    position: fixed;
    top: 4.5rem;
    right: 2rem;
    background-color: var(--modal-bg);
    color: var(--text-primary);
    padding: 1rem;
    border-radius: 1.5rem;
    width: 300px;
    z-index: 99;
    box-shadow: 0 4px 15px var(--glassmorphism-shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--glassmorphism-border);
}

.pomodoro-panel h3 {
    font-size: 1.2rem;
    margin-top: 0.5rem;
    margin-bottom: 0.8rem;
    text-align: center;
    color: var(--powder-blue);
}

.timer-display {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    margin: 0.5rem 0;
}

.timer-controls {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    justify-content: center;
}

.timer-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
}

.timer-controls button {
    background-color: #1e293b;
    color: var(--text-primary);
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 10px 0;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.timer-controls button:hover {
    background-color: #334155;
    transform: translateY(-1px);
}

.timer-controls button:active {
    transform: scale(0.98);
}

#startBtn {
    border-left: 4px solid #3b82f6;
}

#pauseBtn {
    border-left: 4px solid #f59e0b;
}

#resetBtn {
    border-left: 4px solid #a2a4a9;
}

#skipBtn {
    border-left: 4px solid #ef4444;
}

.pomodoro-settings {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pomodoro-settings label {
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pomodoro-settings input {
    background-color: var(--card-bg);
    color: var(--text-primary);
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    width: 5rem;
}

.pomodoro-settings button {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
    color: var(--text);
    padding: 0.4rem 0.6rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s ease;
    margin-top: 0.5rem;
}

.pomodoro-settings button:hover {
    background-color: var(--icon-bg);
}


/* Info Modal styling */
.info-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #1e293b;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
    z-index: 100;
    transition: background-color 0.3s;
}

.info-btn:hover {
    background-color: #334155;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal-box {
    background-color: #0f172a;
    padding: 2rem;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    color: #e2e8f0;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
}

.modal-close-btn:hover {
    color: #f87171;
}

.modal-description {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #ccc;
    text-align: center;
}

.social-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 1.2rem;
}

.social-links a {
    color: #94a3b8;
    font-size: 1.5rem;
    transition: transform 0.2s ease;
}

.social-links a:hover {
    color: #60a5fa;
}

.hidden {
    display: none;
}

.privacy-link a {
    color: var(--powder-blue-dark);
    text-decoration: underline;
    font-size: 0.9rem;
}
.privacy-link a:hover {
    text-decoration: none;
}
