/* css/style.css */

/* --- CSS VARIABLES --- */
:root {
    --bg-color: #000000;
    --bg-gradient: radial-gradient(circle at center, #1a1a1a 0%, #000000 70%);
    
    /* Solid colors for cards to hide grain */
    --card-bg: #111111; 
    --card-hover: #1a1a1a;
    
    --text-main: #ffffff;
    --text-sub: #cccccc;
    --text-body: #bbbbbb;
    --text-muted: #666666;
    --border-color: rgba(255, 255, 255, 0.2);
    --btn-hover-bg: #ffffff;
    --btn-hover-text: #000000;
    --shadow-color: rgba(255, 255, 255, 0.2);
    --icon-color: #ffffff;
    --accent-green: #4caf50;
    --accent-red: #d32f2f;
    --grain-opacity: 0.05;
}

body.light-mode {
    --bg-color: #ffffff;
    --bg-gradient: radial-gradient(circle at center, #f0f0f0 0%, #ffffff 70%);
    
    /* Solid colors for Light Mode */
    --card-bg: #ffffff;
    --card-hover: #f5f5f5;
    
    --text-main: #000000;
    --text-sub: #333333;
    --text-body: #555555;
    --text-muted: #555555;
    --border-color: rgba(0, 0, 0, 0.2);
    --btn-hover-bg: #000000;
    --btn-hover-text: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --icon-color: #000000;
    --grain-opacity: 0.03;
}

/* --- RESET & BASICS --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { 
    width: 100%; 
    overflow-x: hidden;
    min-height: 100vh;
}

body {
    background-color: var(--bg-color);
    background-image: var(--bg-gradient);
    
    color: var(--text-main);
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    overflow-x: hidden;
    transition: color 0.5s ease, background 0.5s ease;
}

/* --- FILM GRAIN OVERLAY --- */
body::before {
    content: "";
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; 
    z-index: 0; 
    opacity: var(--grain-opacity);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* --- CONTROLS --- */
.controls-group {
    position: absolute; top: 30px; right: 30px;
    display: flex; align-items: center; gap: 20px; 
    z-index: 100;
}
.icon-btn {
    background: none; border: none; padding: 5px;
    display: flex; align-items: center; justify-content: center;
    color: var(--icon-color); transition: transform 0.3s ease;
    text-decoration: none; cursor: pointer;
}
.icon-btn svg { width: 22px; height: 22px; fill: var(--icon-color); }
.icon-btn:hover svg { transform: scale(1.1); }
.theme-toggle:hover svg { transform: rotate(15deg) scale(1.1); }

/* --- LANDING PAGE --- */
.container { text-align: center; width: 100%; max-width: 900px; padding: 20px; position: relative; z-index: 10; }

.signature-font {
    font-family: 'Cinzel', serif; font-weight: 400; font-size: 5rem; line-height: 1.2;
    padding: 10px 0; letter-spacing: 2px; color: transparent;
    background: linear-gradient(to right, var(--text-main) 20%, #888 50%, var(--text-main) 80%);
    background-size: 200% auto; -webkit-background-clip: text; background-clip: text;
    animation: shine 5s linear infinite;
}
body.light-mode .signature-font {
    background: linear-gradient(to right, #000 20%, #666 50%, #000 80%);
    background-size: 200% auto; -webkit-background-clip: text; background-clip: text;
}
.job-title { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 5px; color: var(--text-sub); margin-top: 10px; margin-bottom: 50px; font-weight: 400; }
.bio-text { font-size: 1.05rem; max-width: 680px; color: var(--text-body); margin: 0 auto 50px auto; line-height: 1.9; }
.credentials { font-size: 0.65rem; letter-spacing: 3px; color: var(--text-body); text-transform: uppercase; margin-top: 40px; opacity: 0.7; }
.actions-wrapper { display: flex; flex-direction: column; align-items: center; gap: 30px; margin-bottom: 60px; }

.btn {
    text-decoration: none; color: var(--text-main);
    border: 1px solid var(--border-color); padding: 16px 50px;
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 3px;
    transition: all 0.4s ease; 
    background-color: var(--bg-color); 
    display: inline-block; cursor: pointer;
}

.social-row { display: flex; gap: 30px; }

/* UPDATED: Removed background color for LinkedIn/Instagram icons */
.social-link {
    color: var(--text-main); opacity: 0.8; transition: all 0.3s ease;
    display: flex; align-items: center; justify-content: center;
    padding: 10px; border-radius: 50%;
    background-color: transparent;
}
.social-link svg { width: 24px; height: 24px; fill: currentColor; }
.btn:hover, .social-link:hover {
    background-color: var(--btn-hover-bg); color: var(--btn-hover-text);
    border-color: var(--btn-hover-bg); box-shadow: 0px 0px 15px var(--shadow-color);
    transform: translateY(-3px);
}
.social-link:hover { background-color: transparent; color: var(--text-main); filter: drop-shadow(0px 0px 8px var(--shadow-color)); }

/* --- LOGIN GATE --- */
#login-gate {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: #000000; z-index: 9999;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    transition: opacity 0.5s ease;
}
.login-box { display: flex; flex-direction: column; align-items: center; text-align: center; }
.login-header { font-family: 'Space Mono', monospace; font-size: 2.5rem; margin-bottom: 20px; text-transform: uppercase; letter-spacing: -1px; color: #fff; }
.pin-input {
    background: transparent; border: none; border-bottom: 1px solid #666;
    color: #fff; font-family: 'Montserrat', sans-serif; font-size: 2rem;
    text-align: center; letter-spacing: 10px; width: 250px; outline: none; margin-top: 20px;
    transition: border-color 0.3s;
}
.pin-input:focus { border-bottom-color: #fff; }
.error-msg { color: var(--accent-red); font-size: 0.8rem; margin-top: 15px; opacity: 0; transition: opacity 0.3s; font-family: 'Montserrat', sans-serif; }
/* Auth Input Override for Editor */
.auth-input { width: 80%; max-width: 300px; font-size: 1.2rem; letter-spacing: 2px; margin-bottom: 15px; text-align: center; }

/* --- DASHBOARD / GENERAL LAYOUT --- */
.dashboard-container {
    width: 100%; max-width: 900px; position: relative; z-index: 10;
    display: none; flex-direction: column; gap: 20px;
    animation: fadeIn 1s ease forwards; padding-bottom: 40px;
}
.header-section { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 5px; padding: 0 5px; }
.header-greeting {
    font-family: 'Space Mono', monospace; font-size: 2rem;
    text-transform: uppercase; letter-spacing: -1px; line-height: 1;
    background: linear-gradient(to right, var(--text-main) 20%, #888 50%, var(--text-main) 80%);
    background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: shine 10s linear infinite;
}
body.light-mode .header-greeting { background: linear-gradient(to right, #000 20%, #666 50%, #000 80%); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; }
.date-display { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 2px; color: var(--text-muted); }

/* --- CARDS (TILES) --- */
.card {
    background: var(--card-bg); 
    border: 1px solid var(--border-color); 
    border-radius: 18px;
    padding: 20px; 
    transition: all 0.3s ease; 
    display: flex; 
    flex-direction: column;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.card:hover {
    background: var(--card-hover); 
    transform: translateY(-2px);
    border-color: rgba(125,125,125,0.4); 
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.card-title { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 2px; color: var(--text-muted); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.split-section { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; width: 100%; }

/* --- CLOCKS --- */
.clocks-card { flex-direction: row; justify-content: space-between; align-items: center; padding: 25px; }
.clock-item { text-align: center; flex: 1; border-right: 1px solid var(--border-color); }
.clock-item:last-child { border-right: none; }
.clock-time { font-size: 1.5rem; font-weight: 300; color: var(--text-main); margin-bottom: 5px; }
.clock-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 2px; color: var(--text-muted); }

/* --- APP TILES --- */
.app-grid { display: grid; grid-template-columns: repeat(auto-fit, 85px); justify-content: flex-start; gap: 20px; margin-top: 15px; }
.app-tile {
    width: 85px; height: 85px; 
    background: linear-gradient(145deg, var(--card-bg), var(--card-hover));
    border: 1px solid var(--border-color); border-radius: 18px;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    padding-top: 20px; text-decoration: none; transition: all 0.3s ease; box-sizing: border-box;
}
.app-tile svg { width: 26px; height: 26px; fill: var(--text-main); margin-bottom: 8px; flex-shrink: 0; }
.app-label { font-size: 0.5rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-sub); text-align: center; line-height: 1.2; width: 100%; padding: 0 4px; }
.app-tile:hover { background: var(--text-main); transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.2); }
.app-tile:hover svg { fill: var(--bg-color); }
.app-tile:hover .app-label { color: var(--bg-color); }

/* --- CALENDAR --- */
.calendar-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; padding: 0 5px; }
.cal-nav-btn {
    background: none; border: 1px solid var(--border-color); color: var(--text-main);
    width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: 0.2s; font-size: 0.7rem;
}
.cal-nav-btn:hover { background: var(--text-main); color: var(--bg-color); }
.cal-controls { display: flex; gap: 8px; align-items: center; }
select.cal-select {
    background: transparent; color: var(--text-main); border: none; padding: 2px;
    font-family: inherit; font-size: 0.75rem; cursor: pointer; outline: none;
    text-transform: uppercase; letter-spacing: 1px; font-weight: 500;
}
select.cal-select option { background: #000; color: #fff; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 5px; min-height: 250px; }
.cal-day {
    aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; background: var(--card-bg); 
    border: 1px solid var(--border-color); cursor: pointer; border-radius: 10px;
    transition: 0.2s; color: var(--text-sub);
}
.cal-day:not(.cal-header):not(.cal-empty):hover {
    background: var(--text-main); border-color: var(--text-main); color: var(--bg-color); transform: translateY(-2px);
}
.cal-day.selected { background: var(--text-main); color: var(--bg-color); border-color: var(--text-main); font-weight: 600; }
.cal-header { border: none; color: var(--text-muted); font-size: 0.65rem; cursor: default; background: transparent; font-weight: 500; text-align: center; }
.cal-header:hover { background: transparent; transform: none; color: var(--text-muted); border-color: transparent; }
.cal-empty { pointer-events: none; background: transparent; border: none; }

/* --- ENVIRONMENT WIDGET --- */
.env-container { display: flex; flex-direction: column; height: 100%; justify-content: space-between; gap: 15px; padding-top: 5px; }
.env-header { display: flex; justify-content: space-between; align-items: center; }
.env-temp { font-size: 2.2rem; font-weight: 300; line-height: 1; }
.env-meta { text-align: right; }
.env-condition { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-sub); }
.env-location { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }

/* Forecast (Vertical List with Scroll) */
.forecast-wrapper {
    margin: 1.5rem 0;
}

.forecast-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 5px; 
    margin-bottom: 1.25rem;
}

/* Custom Scrollbar */
.forecast-grid::-webkit-scrollbar { width: 4px; }
.forecast-grid::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); }
.forecast-grid::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 2px; }

.forecast-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(125, 125, 125, 0.1);
    padding: 12px 15px;
    border-radius: 8px;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.forecast-item:hover { background: rgba(125, 125, 125, 0.2); }
.forecast-time { font-size: 0.85rem; opacity: 0.8; margin: 0; font-weight: 400; width: 50px; }
.forecast-cond { font-size: 0.75rem; text-transform: uppercase; color: var(--text-sub); letter-spacing: 0.5px; flex-grow: 1; text-align: right; margin-right: 15px; opacity: 0.7; }
.forecast-temp { font-weight: 500; font-size: 1rem; width: 35px; text-align: right; }

.sun-times {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem