:root {
    --bg: #050816;
    --bg-secondary: #0c1533;
    --surface: rgba(255, 255, 255, 0.08);
    --surface-strong: rgba(15, 23, 42, 0.88);
    --border: rgba(255, 255, 255, 0.12);
    --text: #ffffff;
    --muted: #94a3b8;
    --primary: #00d9ff;
    --primary-soft: rgba(0, 217, 255, 0.18);
    --shadow: rgba(0, 0, 0, 0.28);
}

body.light {
    --bg: #eef3ff;
    --bg-secondary: #dfe8ff;
    --surface: rgba(255, 255, 255, 0.72);
    --surface-strong: rgba(255, 255, 255, 0.92);
    --border: rgba(15, 23, 42, 0.12);
    --text: #101828;
    --muted: #475467;
    --primary: #2563eb;
    --primary-soft: rgba(37, 99, 235, 0.14);
    --shadow: rgba(15, 23, 42, 0.12);
}

/* ---------- Reset ---------- */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    transition:
        background 0.35s ease,
        color 0.35s ease;
}

/* ---------- Background ---------- */

.background {
    position: fixed;
    inset: 0;
    z-index: -10;
    overflow: hidden;
    background:
        linear-gradient(
            135deg,
            var(--bg),
            var(--bg-secondary),
            var(--bg)
        );
    transition: background 0.35s ease;
}

.stars {
    position: absolute;
    width: 200%;
    height: 200%;
    background-image:
        radial-gradient(
            rgba(255, 255, 255, 0.9) 1px,
            transparent 1px
        );
    background-size: 40px 40px;
    opacity: 0.25;
    animation: starsMove 160s linear infinite;
}

body.light .stars {
    opacity: 0.08;
}

@keyframes starsMove {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-1200px);
    }
}

/* ---------- Glow ---------- */

.glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(100px);
}

.glow1 {
    width: 420px;
    height: 420px;
    background: rgba(0, 217, 255, 0.20);
    top: -180px;
    left: -180px;
}

.glow2 {
    width: 500px;
    height: 500px;
    background: rgba(124, 77, 255, 0.20);
    right: -220px;
    bottom: -220px;
}

body.light .glow1 {
    background: rgba(37, 99, 235, 0.12);
}

body.light .glow2 {
    background: rgba(124, 77, 255, 0.10);
}

/* ---------- Navbar ---------- */

nav {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 8%;
    position: sticky;
    top: 0;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    background: var(--surface-strong);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: background 0.35s ease, border-color 0.35s ease;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}

.logo i {
    font-size: 1.4rem;
    text-shadow: 0 0 12px rgba(0, 217, 255, 0.7);
}

nav ul {
    display: flex;
    gap: 30px;
    list-style: none;
}

nav ul li a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: 0.3s ease;
}

nav ul li a:hover {
    color: var(--primary);
}

.nav-icons {
    display: flex;
    gap: 20px;
}

.nav-icons i {
    color: var(--text);
    cursor: pointer;
    transition: 0.3s ease;
}

.nav-icons i:hover {
    color: var(--primary);
    transform: rotate(15deg) scale(1.08);
}

/* ---------- Main ---------- */

main {
    width: min(1200px, 92%);
    margin: auto;
    padding: 40px 0;
}

/* ---------- Glass ---------- */

.glass {
    background: var(--surface);
    border: 1px solid var(--border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 10px 40px var(--shadow);
    transition:
        background 0.35s ease,
        border-color 0.35s ease,
        box-shadow 0.35s ease;
}

/* ---------- Hero ---------- */

.hero {
    text-align: center;
    padding: 60px 20px;
    margin-bottom: 35px;
    animation:
        fadeUp 0.8s ease,
        floating 6s ease-in-out infinite;
}

#greeting {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1.4rem;
}

#clock {
    font-family: 'Orbitron', sans-serif;
    font-size: 5rem;
    letter-spacing: 4px;
    margin-bottom: 15px;
}

#date {
    color: var(--muted);
}

/* ---------- Search ---------- */

.search-section {
    padding: 25px;
    margin-bottom: 50px;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--surface-strong);
    padding: 18px 22px;
    border: 1px solid transparent;
    border-radius: 18px;
    transition: 0.35s ease;
}

.search-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 25px var(--primary-soft);
}

.search-container i {
    color: var(--primary);
    font-size: 1.2rem;
}

.search-container input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 17px;
    outline: none;
    font-family: inherit;
}

.search-container input::placeholder {
    color: var(--muted);
}

/* ---------- Section Titles ---------- */

.section-title {
    text-align: center;
    margin: 35px 0;
    color: var(--primary);
    font-size: 1.8rem;
}

/* ---------- Quick Links ---------- */

.links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 25px;
    margin-bottom: 60px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 35px 20px;
    text-align: center;
    cursor: pointer;
    transition: 0.35s ease;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    background: var(--primary-soft);
    border-radius: 50%;
    top: -90px;
    right: -90px;
    transition: 0.4s ease;
}

.card::after {
    content: "";
    position: absolute;
    top: -100%;
    left: -40%;
    width: 35%;
    height: 250%;
    background: rgba(255, 255, 255, 0.12);
    transform: rotate(25deg);
    transition: 0.6s ease;
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 0 25px var(--primary-soft);
}

.card:hover::before {
    transform: scale(1.4);
}

.card:hover::after {
    left: 120%;
}

.card i {
    position: relative;
    z-index: 1;
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 18px;
    transition: 0.3s ease;
}

.card:hover i {
    transform: scale(1.15);
    text-shadow: 0 0 20px var(--primary);
}

.card h3,
.card p {
    position: relative;
    z-index: 1;
}

.card h3 {
    margin-bottom: 10px;
    font-size: 1.15rem;
}

.card p {
    color: var(--muted);
    font-size: 0.9rem;
}

/* ---------- Dashboard Widgets ---------- */

.widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.widget {
    padding: 30px;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: 0.35s ease;
}

.widget:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 0 25px var(--primary-soft);
}

.widget h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    margin-bottom: 18px;
}

.widget p {
    color: var(--muted);
    line-height: 1.7;
}

/* ---------- Todo ---------- */

.todo-container {
    margin-top: 20px;
}

.todo-container input {
    width: 100%;
    padding: 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: var(--surface-strong);
    color: var(--text);
    margin-bottom: 12px;
    font-family: inherit;
    outline: none;
    transition: 0.3s ease;
}

.todo-container input:focus {
    border-color: var(--primary);
}

.todo-container input::placeholder {
    color: var(--muted);
}

.todo-container > button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background: var(--primary);
    color: #08111f;
    font-weight: 600;
    font-family: inherit;
    transition: 0.3s ease;
}

.todo-container > button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--primary-soft);
}

#todoList {
    list-style: none;
    margin-top: 15px;
}

#todoList li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 10px;
    color: var(--text);
}

#todoList li span {
    overflow-wrap: anywhere;
}

#todoList button {
    width: auto;
    padding: 6px 10px;
    border: none;
    border-radius: 8px;
    background: #ef4444;
    color: white;
    cursor: pointer;
    font-family: inherit;
}

/* ---------- Weather ---------- */

#weather {
    text-align: center;
    margin-top: 20px;
}

#temperature {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 10px;
}

#city {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

#description {
    color: var(--muted);
    margin-bottom: 15px;
}

.weather-info {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
    color: var(--muted);
    gap: 12px;
}

/* ---------- NASA APOD ---------- */

#nasaContainer {
    width: 100%;
}

#apodImage,
#apodVideo {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 16px;
    margin-top: 15px;
    background: var(--surface-strong);
}

#apodTitle {
    margin-top: 15px;
    color: var(--primary);
    font-size: 18px;
}

#apodDate {
    color: var(--muted);
    margin-top: 8px;
}

/* ---------- Footer ---------- */

footer {
    margin-top: 80px;
    text-align: center;
    padding: 30px;
    border-top: 1px solid var(--border);
}

footer p {
    font-size: 1rem;
    margin-bottom: 8px;
}

footer small {
    color: var(--muted);
}

/* ---------- Animations ---------- */

.hero,
.search-section,
.card,
.widget {
    animation: fadeUp 0.8s ease;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes floating {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* ---------- Scrollbar ---------- */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
    opacity: 0.8;
}

/* ---------- Selection ---------- */

::selection {
    background: var(--primary);
    color: #08111f;
}

/* ---------- Responsive ---------- */

@media (max-width: 992px) {
    nav {
        padding: 18px 5%;
    }

    .logo {
        font-size: 1.1rem;
    }

    nav ul {
        gap: 18px;
    }

    #clock {
        font-size: 3.8rem;
    }
}

@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 20px;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    .search-container {
        padding: 15px;
    }

    .search-container input {
        font-size: 15px;
    }

    #clock {
        font-size: 3rem;
    }

    .links {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .widgets {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    main {
        width: 94%;
        padding: 25px 0;
    }

    .hero {
        padding: 40px 15px;
    }

    #clock {
        font-size: 2.2rem;
        letter-spacing: 2px;
    }

    #greeting {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .card {
        padding: 25px 15px;
    }

    .card i {
        font-size: 2.4rem;
    }

    .widget {
        padding: 22px;
    }

    .weather-info {
        flex-direction: column;
    }
}

.add-link-btn {

    display: block;

    margin: 25px auto 60px;

    padding: 13px 22px;

    border: 1px solid var(--border);

    border-radius: 12px;

    background: var(--primary);

    color: #08111f;

    font-family: inherit;

    font-weight: 600;

    cursor: pointer;

    transition: 0.3s ease;

}

.add-link-btn:hover {

    transform: translateY(-3px);

    box-shadow: 0 0 25px var(--primary-soft);

}


/* Link card */

.custom-link {

    position: relative;

}

.custom-link-actions {

    position: absolute;

    top: 10px;

    right: 10px;

    display: flex;

    gap: 6px;

    z-index: 5;

}

.custom-link-actions button {

    width: 30px;

    height: 30px;

    border: none;

    border-radius: 8px;

    background: rgba(0, 0, 0, 0.45);

    color: white;

    cursor: pointer;

    transition: 0.2s;

}

.custom-link-actions button:hover {

    background: var(--primary);

    color: #08111f;

}


/* Modal */

.link-modal {

    position: fixed;

    inset: 0;

    display: none;

    align-items: center;

    justify-content: center;

    background: rgba(0, 0, 0, 0.65);

    backdrop-filter: blur(8px);

    z-index: 2000;

    padding: 20px;

}

.link-modal.active {

    display: flex;

}

.link-modal-content {

    width: min(450px, 100%);

    padding: 30px;

}

.modal-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 25px;

}

.modal-header h3 {

    color: var(--primary);

}

.modal-header button {

    width: 35px;

    height: 35px;

    border: none;

    border-radius: 8px;

    background: var(--surface);

    color: var(--text);

    cursor: pointer;

}

.link-modal-content input {

    width: 100%;

    padding: 13px;

    margin-bottom: 15px;

    border-radius: 10px;

    border: 1px solid var(--border);

    outline: none;

    background: var(--surface-strong);

    color: var(--text);

    font-family: inherit;

}

.link-modal-content input:focus {

    border-color: var(--primary);

}

.modal-actions {

    display: flex;

    gap: 10px;

    margin-top: 10px;

}

.modal-actions button {

    flex: 1;

    padding: 12px;

    border: none;

    border-radius: 10px;

    cursor: pointer;

    font-family: inherit;

    font-weight: 600;

}

#cancelLink {

    background: var(--surface);

    color: var(--text);

}

#saveLink {

    background: var(--primary);

    color: #08111f;

}

@media (max-width: 480px) {

    .modal-actions {

        flex-direction: column;

    }

}

.custom-link-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
    z-index: 10;
}

.custom-link-actions button {
    width: 32px;
    height: 32px;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: 8px;

    background: rgba(0, 0, 0, 0.45);
    color: white;

    cursor: pointer;
    transition: 0.2s ease;
}

/* IMPORTANT: override .card i */
.custom-link-actions button i {
    font-size: 14px;
    margin: 0;
    color: white;
    position: static;
    text-shadow: none;
}

.custom-link-actions button:hover {
    background: var(--primary);
    transform: translateY(-2px);
}


.custom-link-actions button:hover i {
    color: #08111f;
}

.pomodoro-section{

    margin-top:70px;

}

.pomodoro-card{

    max-width:500px;

    margin:auto;

    padding:40px;

    text-align:center;

}

#timerMode{

    color:var(--primary);

    margin-bottom:20px;

}

#timerDisplay{

    font-size:72px;

    font-weight:700;

    margin:20px 0;

    font-family:'Orbitron',sans-serif;

}

.timer-buttons{

    display:flex;

    justify-content:center;

    gap:15px;

    margin-top:30px;

    flex-wrap:wrap;

}

.timer-buttons button{

    padding:14px 25px;

    border:none;

    border-radius:12px;

    background:var(--primary);

    color:#08111f;

    font-size:16px;

    font-weight:600;

    cursor:pointer;

    transition:.3s;

}

.timer-buttons button:hover{

    transform:translateY(-3px);

    box-shadow:0 0 20px var(--primary-soft);

}

#sessionCounter{

    margin-top:15px;

    color:var(--muted);

    font-size:17px;

}