/* ============================================
   STYLE.CSS - Umar Kalyal Portfolio
   Vibrant, Modern Design with Dark/Light Mode
   ============================================ */

/* ===== GOOGLE FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:ital,wght@0,400;0,600;1,400&family=Inter:wght@300;400;500;600;700&display=swap');

/* ===== CSS VARIABLES - LIGHT MODE ===== */
:root {
    /* Brand Colors */
    --cyan: #00d9ff;
    --cyan-dark: #00a8c8;
    --pink: #ff006e;
    --pink-dark: #cc0058;
    --gold: #ffbe0b;
    --gold-dark: #e0a500;
    --purple: #7c3aed;

    /* Light Mode Surfaces */
    --bg-page: #f0f4ff;
    --bg-sidebar: linear-gradient(160deg, #0099bb 0%, #006080 50%, #004d6b 100%);
    --bg-main: #ffffff;
    --bg-card: #ffffff;
    --bg-navbar: #ffffff;
    --bg-skill: rgba(255,255,255,0.18);

    /* Light Mode Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-light: #94a3b8;
    --text-sidebar: #ffffff;
    --text-sidebar-muted: rgba(255,255,255,0.75);

    /* Light Mode Borders */
    --border: #e2e8f0;
    --border-card: #e2e8f0;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);
    --shadow-card-hover: 0 16px 40px rgba(255,0,110,0.18), 0 4px 12px rgba(255,0,110,0.10);
    --shadow-sidebar: 6px 0 32px rgba(0,0,0,0.15);

    /* Layout */
    --sidebar-width: 300px;
    --navbar-height: 64px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-pill: 999px;

    /* Transitions */
    --t-fast: 0.15s ease;
    --t-smooth: 0.28s cubic-bezier(0.4, 0, 0.2, 1);

    /* Fonts */
    --font-display: 'Crimson Text', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ===== DARK MODE ===== */
[data-theme="dark"] {
    --bg-page: #0a0f1e;
    --bg-sidebar: linear-gradient(160deg, #0d1a24 0%, #071318 50%, #050d10 100%);
    --bg-main: #111827;
    --bg-card: #1e2638;
    --bg-navbar: #111827;
    --bg-skill: rgba(0,217,255,0.10);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-light: #64748b;
    --text-sidebar: #e2f8ff;
    --text-sidebar-muted: rgba(200,240,255,0.65);

    --border: #1e2d3d;
    --border-card: #253044;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
    --shadow-card-hover: 0 16px 40px rgba(0,217,255,0.15), 0 4px 12px rgba(0,217,255,0.08);
    --shadow-sidebar: 6px 0 32px rgba(0,0,0,0.5);

    --cyan: #00d9ff;
    --pink: #ff4d9d;
    --gold: #ffca2c;
}

/* ===== RESET ===== */
*, *::before, *::after {
    margin: 0; padding: 0; box-sizing: border-box;
}
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.65;
    font-size: 16px;
    transition: background var(--t-smooth), color var(--t-smooth);
}

/* ===== TYPOGRAPHY ===== */
h1,h2,h3,h4 {
    font-family: var(--font-display);
    line-height: 1.2;
    font-weight: 600;
}
h2 { font-size: 2rem; margin-bottom: 1.5rem; }
h3 { font-size: 1.4rem; }
p { margin-bottom: 1rem; color: var(--text-secondary); }
a { color: var(--pink); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--gold); }

/* ===== LAYOUT ===== */
.container {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    left: 0; top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-sidebar);
    box-shadow: var(--shadow-sidebar);
    padding: 2rem 1.5rem;
    overflow-y: auto;
    z-index: 1000;
    transition: background var(--t-smooth);
}

/* Sidebar top accent line */
.sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--cyan), var(--pink), var(--gold));
}

.sidebar-content { flex: 1; }

/* ===== PROFILE ===== */
.profile {
    text-align: center;
    margin-bottom: 2.5rem;
    animation: fadeInDown 0.6s ease forwards;
}

.profile-picture {
    display: block;
    margin: 0 auto 1.25rem;
    width: 110px; height: 110px;
    border-radius: 50%;
    border: 3px solid var(--gold);
    object-fit: cover;
    box-shadow: 0 0 0 6px rgba(255,190,11,0.18), 0 8px 24px rgba(0,0,0,0.3);
    transition: transform var(--t-smooth), box-shadow var(--t-smooth);
}
.profile-picture:hover {
    transform: scale(1.05);
    box-shadow: 0 0 0 8px rgba(255,190,11,0.25), 0 12px 32px rgba(0,0,0,0.4);
}

.profile .name {
    font-family: 'Crimson Text', serif;
    font-size: 1.75rem;
    color: var(--text-sidebar);
    margin-bottom: 0.5rem;
    letter-spacing: 0.3px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.profile .tagline {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1rem;
    color: var(--gold);
    margin: 0;
    line-height: 1.5;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
    letter-spacing: 0.2px;
}

/* ===== SIDEBAR SECTIONS ===== */
.sidebar-section {
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease forwards;
}

.section-title {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--cyan);
    margin-bottom: 0.85rem;
}

/* ===== SKILLS ===== */
.skills-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.skills-list li {
    background: var(--bg-skill);
    color: var(--cyan);
    border: 1px solid rgba(0,217,255,0.35);
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.775rem;
    font-weight: 500;
    transition: all var(--t-smooth);
    cursor: default;
}
.skills-list li:hover {
    background: var(--cyan);
    color: #001a22;
    border-color: var(--cyan);
    transform: translateY(-2px) scale(1.06);
    box-shadow: 0 4px 12px rgba(0,217,255,0.35);
}

/* ===== STATUS ===== */
.status-text {
    color: var(--text-sidebar-muted);
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.6;
    display: flex;
    align-items: center;
    gap: 8px;
}
.status-text::before {
    content: '';
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #00ff88;
    flex-shrink: 0;
    box-shadow: 0 0 6px rgba(0,255,136,0.6);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 4px rgba(0,255,136,0.5); }
    50% { box-shadow: 0 0 10px rgba(0,255,136,0.9); }
}

/* ===== SIDEBAR FOOTER ===== */
.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.10);
    padding-top: 1.5rem;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1rem;
}
.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.20);
    border-radius: var(--radius-sm);
    color: var(--text-sidebar);
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--t-smooth);
}
.social-icon:hover {
    background: var(--pink);
    border-color: var(--pink);
    color: #fff;
    transform: translateY(-3px) scale(1.12);
    box-shadow: 0 8px 20px rgba(255,0,110,0.45);
}
.footer-text {
    color: rgba(255,255,255,0.3);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0;
}

/* ===== DARK MODE TOGGLE ===== */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.25rem;
}
.theme-toggle-btn {
    position: relative;
    width: 46px; height: 24px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: background var(--t-smooth);
    flex-shrink: 0;
}
.theme-toggle-btn::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 16px; height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--t-smooth), background var(--t-smooth);
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
[data-theme="dark"] .theme-toggle-btn {
    background: rgba(0,217,255,0.3);
    border-color: rgba(0,217,255,0.5);
}
[data-theme="dark"] .theme-toggle-btn::after {
    transform: translateX(22px);
    background: var(--cyan);
}
.theme-label {
    font-size: 0.75rem;
    color: var(--text-sidebar-muted);
    font-weight: 500;
    letter-spacing: 0.5px;
    user-select: none;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== NAVBAR ===== */
.navbar {
    position: sticky;
    top: 0;
    background: var(--bg-navbar);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    z-index: 500;
    box-shadow: var(--shadow-sm);
    transition: background var(--t-smooth), border-color var(--t-smooth);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.nav-link {
    position: relative;
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    transition: all var(--t-smooth);
}
.nav-link:hover {
    color: var(--pink);
    background: rgba(255,0,110,0.07);
}
.nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    box-shadow: 0 4px 14px rgba(255,0,110,0.35);
}
.nav-link.active:hover { color: #fff; }

/* ===== CONTENT AREA ===== */
.content {
    background: var(--bg-main);
    border-radius: var(--radius);
    padding: 2.5rem 3rem;
    margin: 2rem;
    box-shadow: var(--shadow-md);
    flex: 1;
    transition: background var(--t-smooth), box-shadow var(--t-smooth);
    border: 1px solid var(--border);
}
.content h2 {
    color: var(--text-primary);
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
}
.content h2::after {
    content: '';
    position: absolute;
    bottom: -8px; left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--cyan), var(--pink));
    border-radius: 2px;
}

/* ===== ABOUT ===== */
.about-section { animation: fadeIn 0.5s ease; }
.about-section p {
    font-size: 1.08rem;
    line-height: 1.85;
    color: var(--text-secondary);
}
.about-section p:first-of-type::first-letter {
    font-size: 2.4rem;
    font-family: var(--font-display);
    font-weight: 600;
    float: left;
    line-height: 1;
    margin: 4px 8px 0 0;
    color: var(--pink);
}

/* ===== CARD GRID ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
    animation: fadeIn 0.5s ease;
}
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform var(--t-smooth), box-shadow var(--t-smooth), border-color var(--t-smooth);
    box-shadow: var(--shadow-sm);
}
.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--pink);
}
[data-theme="dark"] .card:hover { border-color: var(--cyan); }

.card-image {
    width: 100%; height: 220px;
    overflow: hidden;
    background: var(--border);
}
.card-image img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform var(--t-smooth);
}
.card:hover .card-image img { transform: scale(1.06); }

.card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.card-title {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}
.card-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    flex: 1;
    margin-bottom: 1rem;
}
.card-link {
    color: var(--pink);
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all var(--t-fast);
    width: fit-content;
    padding: 6px 14px;
    border: 1.5px solid var(--pink);
    border-radius: var(--radius-pill);
}
.card-link:hover {
    background: var(--pink);
    color: #fff;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(255,0,110,0.3);
}
[data-theme="dark"] .card-link { color: var(--cyan); border-color: var(--cyan); }
[data-theme="dark"] .card-link:hover { background: var(--cyan); color: #001a22; }

.blog-date {
    color: var(--cyan);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    font-weight: 600;
}
[data-theme="dark"] .blog-date { color: var(--gold); }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes fadeInDown {
    from { opacity:0; transform:translateY(-12px); }
    to { opacity:1; transform:translateY(0); }
}
@keyframes fadeInUp {
    from { opacity:0; transform:translateY(12px); }
    to { opacity:1; transform:translateY(0); }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--cyan), var(--pink));
    border-radius: 4px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .card-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
    .content { padding: 2rem; }
}

@media (max-width: 768px) {
    :root { --sidebar-width: 100%; }
    .container { flex-direction: column; }
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
        padding: 1.5rem;
        gap: 1rem;
    }
    .sidebar-content { flex: 1 1 200px; }
    .sidebar::before { height: 3px; }
    .profile { text-align: left; margin-bottom: 0; display: flex; align-items: center; gap: 1rem; }
    .profile-picture { margin: 0; width: 72px; height: 72px; }
    .profile .name { font-size: 1.3rem; margin-bottom: 0.2rem; }
    .profile .tagline { font-size: 0.85rem; }
    .sidebar-section { display: none; }
    .sidebar-section.status-section { display: block; }
    .sidebar-footer {
        border-top: none; border-left: 1px solid rgba(255,255,255,0.1);
        padding-top: 0; padding-left: 1.5rem; margin-top: 0;
        flex: 0 0 auto;
    }
    .main-content { margin-left: 0; width: 100%; }
    .navbar { justify-content: center; }
    .content { margin: 1rem; padding: 1.5rem; }
    .card-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .sidebar { flex-direction: column; }
    .sidebar-footer { border-left: none; border-top: 1px solid rgba(255,255,255,0.1); padding-left: 0; padding-top: 1rem; width: 100%; }
    .nav-links { gap: 0.25rem; }
    .nav-link { padding: 6px 12px; font-size: 0.8rem; }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
@media print {
    .sidebar, .navbar { display: none; }
    .main-content { margin-left: 0; }
}
