:root {
    --bg-color: #000814;
    --card-bg: rgba(10, 25, 47, 0.65); 
    --text-color: #e0e6ed; 
    --secondary-text: #94a3b8;
    --accent-color: #3a86ff;
    --link-color: #4cc9f0; 
    --border-color: rgba(58, 134, 255, 0.3);
    --card-hover: rgba(58, 134, 255, 0.15);
    --footer-bg: rgba(0, 0, 0, 0.4);
    --terminal-bar-bg: rgba(0,0,0,0.3);
    --btn-bg: rgba(255, 255, 255, 0.05);
}
 
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "JetBrains Mono", monospace;
    background: radial-gradient(circle at top, #001d3d, #000814 60%);
    color: var(--text-color);
    line-height: 1.6;
    transition: background 0.3s ease;
}

body.light {
    --bg-color: #f5f7fa;
    --card-bg: rgba(255, 255, 255, 0.7);
    --text-color: #1d3557;
    --secondary-text: #457b9d;
    --accent-color: #3a86ff;
    --link-color: #0056b3; 
    --border-color: rgba(58, 134, 255, 0.2);
    --card-hover: rgba(58, 134, 255, 0.08);
    --footer-bg: rgba(255, 255, 255, 0.3);
    --terminal-bar-bg: rgba(230, 233, 240, 0.9);
    --btn-bg: #ffffff;
    background: radial-gradient(circle at top, #e0e7ff, #f5f7fa 60%);
}

/* LINKS STYLING */
a {
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px dashed var(--link-color);
    padding-bottom: 1px;
    font-weight: 600;
    transition: all 0.2s ease;
}

a:hover {
    color: #ffffff;
    border-bottom: 1px solid #ffffff;
    background: transparent;
}

body.light a:hover {
    color: #000000;
    border-bottom: 1px solid #000000;
}

.clean-link { border-bottom: none !important; }
.clean-link:hover { border-bottom: none !important; }

/* SCANLINE OVERLAY */
body::after {
    content: " ";
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.05) 50%);
    background-size: 100% 4px;
    z-index: 100;
    pointer-events: none;
    opacity: 0.1;
}

#background-canvas { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    z-index: -1; 
}

.container {
    max-width: 1000px;
    margin: 40px auto;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

/* TERMINAL BAR */
.terminal-bar {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: var(--terminal-bar-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.terminal-controls { display: flex; gap: 8px; flex-shrink: 0; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.red { background: #ff5f56; } 
.yellow { background: #ffbd2e; } 
.green { background: #27c93f; }

.terminal-bar-title { 
    margin-left: 20px; 
    font-size: 0.85em; 
    opacity: 0.8; 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.terminal-actions { margin-left: auto; display: flex; gap: 10px; }

.terminal-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 15px;
    gap: 8px;
    text-decoration: none !important;
    border-bottom: none !important; 
    font-weight: 400 !important;    
    background: var(--btn-bg);
    color: var(--text-color) !important; 
    font-family: "JetBrains Mono", monospace !important;
    font-size: 13px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.terminal-toggle:hover {
    background: var(--accent-color);
    color: #ffffff !important;
    border-color: var(--accent-color);
    border-bottom: none !important;
}

/* HEADER */
header { 
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding: 30px 40px; 
    border-bottom: 1px dashed var(--border-color); 
}

.header-info { display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
header h1 { margin: 0; font-size: 2.2em; }
.subtitle { display: flex; flex-direction: column; margin: 5px 0 12px 0; line-height: 1.4; font-weight: 400; }
.subtitle span { display: block; }

.profile-photo {
    width: 130px; 
    height: 130px;
    border-radius: 50%; 
    border: 3px solid var(--accent-color);
    box-shadow: 0 0 20px rgba(58, 134, 255, 0.3);
    object-fit: cover; 
    transition: 0.4s;
}

/* PROFILE PHOTO HOVER GLOW */
.profile-photo:hover { 
    transform: scale(1.1); 
    box-shadow: 0 0 30px 5px var(--accent-color); 
    border-color: var(--accent-color);
}

/* CONTACT ICONS */
.contact-icons { 
    display: flex; 
    justify-content: flex-start; 
    align-items: center; 
    gap: 20px; 
    margin-top: 5px; 
}

.contact-icons img { 
    width: 24px; 
    height: 24px; 
    transition: transform 0.2s ease, filter 0.2s ease; 
}

/* UNIFORM HOVER GLOW FOR ALL ICONS & THEMES */
.contact-icons img:hover { 
    transform: scale(1.5) rotate(5deg); 
    filter: drop-shadow(0 0 10px var(--accent-color)) !important;
}

/* TABS */
.tabs { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; padding: 20px; }
.tab {
    background: transparent; border: none;
    color: var(--text-color); padding: 8px 18px; cursor: pointer;
    font-family: inherit; transition: 0.3s;
    opacity: 0.6;
    font-weight: 600;
    position: relative;
}
.tab::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    width: 0; height: 2px;
    background: var(--accent-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}
.tab:hover, .tab.active { opacity: 1; }
.tab:hover::after, .tab.active::after { width: 80%; }

/* CONTENT AREA */
main { padding: 30px; min-height: 450px; transition: opacity 0.3s ease, transform 0.3s ease; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.command-line { color: var(--accent-color); margin-bottom: 20px; font-size: 1.1em; }

/* TYPEWRITER EFFECT */
.typewriter {
    opacity: 0;
    overflow: hidden;
    animation: fadeIn 0.5s forwards;
    animation-delay: var(--delay);
    margin-bottom: 10px;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* PDF VIEWER */
#pdf-viewer-container {
    width: 100%;
    margin-top: 10px;
    display: none; 
}

#pdf-viewer-container iframe {
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    background: #333;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* CARDS */
.card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(5px);
    padding: 20px; 
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-left: 4px solid var(--accent-color);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: 8px;
    display: block; 
}
.card:hover { 
    background: var(--card-hover); 
    transform: translateY(-5px); 
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    border-color: var(--accent-color);
}
.card h3 {
    margin-top: 0;
    font-size: 1.1em;
    border-bottom: 1px solid rgba(58, 134, 255, 0.15);
    padding-bottom: 8px;
    margin-bottom: 12px;
}
.domain-desc { font-size: 0.95em; line-height: 1.4; color: var(--text-color); }
.company { font-weight: 600; color: var(--secondary-text); margin-bottom: 10px; }
.date { float: right; font-size: 0.85em; opacity: 0.7; }

/* EXPERIENCE LISTS */
#experience ul { list-style: none; padding-left: 0; }
#experience ul li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    font-size: 0.95em;
}
#experience ul li::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

/* SKILLS/PROJECTS GRID */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

/* TAGS */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tag { 
    background: rgba(58, 134, 255, 0.1);
    border: 1px solid var(--accent-color); 
    padding: 3px 10px; 
    border-radius: 4px; 
    font-size: 0.85em; 
    transition: all 0.3s ease;
}
.tag:hover { background: var(--accent-color); color: #fff; transform: translateY(-2px); }

.cursor-line { margin-top: 30px; font-size: 1.2em; border-top: 1px dashed var(--border-color); padding-top: 20px; }
.blink { animation: blink 1s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* FOOTER */
.terminal-footer {
    background: var(--footer-bg);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    padding: 15px 30px;
    font-size: 0.75rem;
}
.footer-content { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.status-group { display: flex; gap: 20px; }
.status-item { display: flex; align-items: center; gap: 6px; color: var(--secondary-text); }
.status-dot { width: 8px; height: 8px; background-color: #27c93f; border-radius: 50%; box-shadow: 0 0 8px #27c93f; }
.copyright { justify-self: center; color: var(--secondary-text); }
.footer-links { display: flex; gap: 15px; justify-self: end; }
.footer-links a { color: var(--link-color) !important; border: none !important; text-decoration: underline; }

/* UX COMPONENTS */
.section-nav { display: flex; justify-content: space-between; margin-top: 40px; padding-top: 20px; border-top: 1px dashed var(--border-color); gap: 15px; }
.nav-btn { background: var(--btn-bg); border: 1px solid var(--border-color); color: var(--text-color); padding: 12px 20px; border-radius: 6px; cursor: pointer; transition: 0.3s; flex: 1; max-width: 100px; }
.nav-btn:hover:not(:disabled) { background: var(--accent-color); color: #fff; transform: translateY(-2px); }
.nav-btn:disabled { opacity: 0.2; cursor: not-allowed; }

#backToTop { display: none; position: fixed; bottom: 80px; right: 30px; z-index: 99; border: 1px solid var(--border-color); background-color: var(--card-bg); color: var(--accent-color); padding: 12px 16px; border-radius: 50%; cursor: pointer; transition: 0.3s; }
#backToTop:hover { transform: translateY(-5px); background-color: var(--accent-color); color: #fff !important; }

/* MOBILE RESPONSIVENESS */
@media (max-width: 600px) {
    .container { margin: 10px; }
    
    header { 
        flex-direction: column; 
        text-align: center; 
        padding: 20px 10px;
        align-items: center; 
    }
    
    .header-info { 
        align-items: center; 
        text-align: center;
        width: 100%;
    }
    
    header h1 { 
        font-size: 1.6em; 
        width: 100%;
    }
    
    header h3, .subtitle, .subtitle span {
        width: 100%;
        text-align: center;
        align-items: center;
        justify-content: center;
    }

    .contact-icons {
        justify-content: center;
        width: 100%;
    }

    .terminal-bar-title { display: none; }
    .date { float: none; display: block; margin-top: 5px; }
    .skills-grid { grid-template-columns: 1fr; }
    
    .footer-content { 
        display: flex; 
        flex-direction: column; 
        gap: 10px; 
        align-items: center;
    }
}

/* THEME SPECIFIC ICON FILTERS */
.header-icon { 
    width: 24px; 
    height: 24px; 
    filter: invert(1); 
}

body.light .header-icon { 
    filter: invert(0); 
}
