/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000814;
    min-height: 100vh;
    color: #333;
    margin: 0;
    padding: 0;
    transition: background 1.5s ease, background-color 1.5s ease, color 1.5s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

/* Top bar (fixed header + clock) */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #000814;
    border-bottom: 1px solid #333;
    transition: background 1.5s ease, background-color 1.5s ease, border-color 1.5s ease, box-shadow 1.5s ease;
}

/* Header styles */
header {
    background: #000814;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    border-bottom: 1px solid #333;
    position: relative;
    transition: background 1.5s ease, background-color 1.5s ease, box-shadow 1.5s ease, border-color 1.5s ease;
}

.logo {
    width: 40px;
    height: 40px;
    background: #967300;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-weight: bold;
    font-size: 18px;
    color: #000814;
    transition: background 1.5s ease, background-color 1.5s ease, color 1.5s ease, box-shadow 1.5s ease;
}

/* Theme toggle */
.theme-toggle {
    position: absolute;
    right: 20px;
}
.theme-toggle button {
    background: #1c5fe5;
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(28,95,229,0.35);
    transition: background 1.5s ease, background-color 1.5s ease, color 1.5s ease, box-shadow 1.5s ease;
}
.theme-toggle button:hover {
    background: #174fc2;
}

header h1 {
    color: white;
    font-size: 1.5rem;
    margin: 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    transition: color 1.5s ease;
}

header h1 button {
    background: #3a86ff;
    color: #ffffff;
    border: none;
    border-radius: 50px;
    padding: 8px 16px;
    font-size: 1.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(58, 134, 255, 0.3);
}

header h1 button:hover {
    background: #2f74ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(58, 134, 255, 0.4);
}

header h1 button:active {
    transform: translateY(0);
    background: #1c5fe5;
}

header p {
    display: none;
}

.datetime-display {
    position: static;
    width: 100%;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
    padding: 10px 20px 10px;
    transition: color 1.5s ease;
}

#current-datetime {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    backdrop-filter: blur(500px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
    font-family: monospace;
    transition: background 1.5s ease, background-color 1.5s ease, border-color 1.5s ease, color 1.5s ease;
}

/* Main content */
main {
    /* background: white; */
    padding: 40px 20px;
    min-height: calc(100vh - 80px);
    margin-top: 120px; /* offset for fixed topbar */
}

/* Websites grid */
.websites-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 10px;
    margin-top: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Website cards */
.website-card {
    background: #000ce6;
    border-radius: 50px;
    padding: 0;
    box-shadow: none;
    transition: background 1.5s ease, background-color 1.5s ease, color 1.5s ease, box-shadow 1.5s ease, border-color 1.5s ease, filter 1.5s ease;
    border: none;
    display: flex;
    flex-direction: column;
}

.website-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.661);
}

.website-card h3 {
    font-size: 20px;
    margin: 0;
    color: rgb(0, 0, 0);
    font-weight: 500;
    padding: 15px 20px;
    text-align: center;
    font-family: monospace;
    transition: color 1.5s ease;
}

.website-card p {
    display: none;
}

/* Buttons */
.redirect-btn, .add-btn {
    width: 100%;
    padding: 15px 20px;
    border: none;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 1.5s ease, background-color 1.5s ease, color 1.5s ease, box-shadow 1.5s ease, border-color 1.5s ease;
    text-transform: none;
    letter-spacing: normal;
    background: #62c3ff;
    color: #ffffff;
    margin: 0;
}

.redirect-btn:hover, .add-btn:hover {
    background: #1c5fe5;
    transform: none;
}

.redirect-btn:active, .add-btn:active {
    background: #1c5fe5;
    color: #ffffff;
}


/* Mobile-first responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0;
    }
    
    header {
        padding: 12px 15px;
    }
    
    header h1 {
        font-size: 1.3rem;
        gap: 10px;
    }
    
    header h1 button {
        font-size: 0.7rem;
        padding: 6px 12px;
        border-radius: 22px;
    }
    
    .datetime-display {
        font-size: 0.8rem;
        padding: 8px 15px 8px;
    }
    
    #current-datetime {
        padding: 6px 10px;
        border-radius: 6px;
        text-align: center;
    }
    
    #current-datetime div:first-child {
        font-size: 0.75em;
        line-height: 1.1;
    }
    
    #current-datetime div:last-child {
        font-size: 0.7em;
    }
    
    .logo {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    main {
        padding: 20px 15px;
        margin-top: 110px; /* smaller offset on tablets/phones */
    }
    
    .websites-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-top: 15px;
    }
    
    .website-card h3 {
        font-size: 0.9rem;
        padding: 12px 15px;
    }
    
    .redirect-btn, .add-btn {
        padding: 12px 15px;
        font-size: 0.85rem;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .container {
        padding: 0;
    }
    
    header {
        padding: 10px 12px;
    }
    
    header h1 {
        font-size: 1.1rem;
        gap: 8px;
    }
    
    header h1 button {
        font-size: 0.65rem;
        padding: 5px 10px;
        border-radius: 18px;
    }
    
    .datetime-display {
        font-size: 0.7rem;
        padding: 6px 12px 6px;
    }
    
    #current-datetime {
        padding: 5px 8px;
        border-radius: 5px;
        text-align: center;
    }
    
    #current-datetime div:first-child {
        font-size: 0.7em;
        line-height: 1.0;
    }
    
    #current-datetime div:last-child {
        font-size: 0.65em;
    }
    
    .logo {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    main {
        padding: 15px 12px;
        margin-top: 100px; /* smallest screens */
    }
    
    .websites-grid {
        gap: 12px;
    }
    
    .website-card h3 {
        font-size: 0.8rem;
        padding: 10px 12px;
    }
    
    .redirect-btn, .add-btn {
        padding: 10px 12px;
        font-size: 0.8rem;
    }
}

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
    .website-card:hover {
        transform: none;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85);
        border-color: transparent;
    }
    
    .redirect-btn:hover, .add-btn:hover {
        transform: none;
    }
    
    .website-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .redirect-btn:active, .add-btn:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
}

/* Animation for page load */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.website-card {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

/* Desktop-only: Blur/dim siblings on hover to create focus effect */
@media (hover: hover) and (pointer: fine) {
    .websites-grid .website-card {
        transition: transform 0.2s ease, box-shadow 0.2s ease, filter 1.5s ease, opacity 0.2s ease;
    }
    /* When mouse is over grid, blur all cards */
    .websites-grid:hover .website-card {
        filter: blur(2px) saturate(0.8);
        opacity: 0.7;
    }
    /* Keep hovered card sharp and on top */
    .websites-grid .website-card:hover {
        filter: none;
        opacity: 1;
        position: relative;
        z-index: 2;
        transform: translateY(-3px); /* subtle lift on focus */
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.7);
    }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    body, .topbar, header, .logo, header h1, .datetime-display, #current-datetime,
    .website-card, .website-card h3, .redirect-btn, .add-btn, .theme-toggle button {
        transition: none !important;
    }
}

/* Light theme overrides */
.light-theme body, body.light-theme {
    background: #f7f9fc;
    color: #111;
}
.light-theme .topbar {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}
.light-theme header {
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    border-bottom: 1px solid transparent;
}
.light-theme header h1 {
    color: #0b1220;
}
.light-theme .logo {
    background: #3a86ff;
    color: #ffffff;
}
.light-theme .datetime-display {
    color: #0b1220;
}
.light-theme #current-datetime {
    background: rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.1);
}
.light-theme .website-card {
    background: #eaf2ff;
    box-shadow: none;
}
.light-theme .website-card h3 {
    color: #0b1220;
}
.light-theme .redirect-btn, .light-theme .add-btn {
    background: #3a86ff;
    color: #ffffff;
}
.light-theme .redirect-btn:hover, .light-theme .add-btn:hover {
    background: #2f74ff;
}
.light-theme .redirect-btn:active, .light-theme .add-btn:active {
    background: #1c5fe5;
}

.website-card:nth-child(1) { animation-delay: 0.1s; }
.website-card:nth-child(2) { animation-delay: 0.2s; }
.website-card:nth-child(3) { animation-delay: 0.3s; }
.website-card:nth-child(4) { animation-delay: 0.4s; }
.website-card:nth-child(5) { animation-delay: 0.5s; }
.website-card:nth-child(6) { animation-delay: 0.6s; }
.website-card:nth-child(7) { animation-delay: 0.7s; }
.website-card:nth-child(8) { animation-delay: 0.8s; }
.website-card:nth-child(9) { animation-delay: 0.9s; }
.website-card:nth-child(10) { animation-delay: 1.0s; }
