/* 
 * Global Stylesheet for Harsh Patel's Website
 * Contains shared styles that apply across all pages
 */

/* Theme Variables */
:root {
    --bg: #ffffff;
    --text: #000000;
    --link: #2563eb;
    --section-bg: rgba(26, 26, 46, 0.03);
    --border: rgba(26, 26, 46, 0.1);
    /* Keyboard Key Variables - Light Mode */
    --key-bg: #f7f7f7;
    --key-border: #ccc;
    --key-text: var(--text);
}

:root[data-theme="dark"] {
    --bg: #0d0d16;
    --text: #ffffff;
    --link: #3d7eff;
    --section-bg: rgba(225, 231, 255, 0.03);
    --border: rgba(225, 231, 255, 0.1);
    /* Keyboard Key Variables - Dark Mode */
    --key-bg: #444;
    --key-border: #666;
    --key-text: var(--text);
}

/* Base Typography */
body {
    font-family: Verdana, sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 1.6;
    max-width: 650px;
    margin: 50px auto;
    padding: 0 20px;
    background: var(--bg);
    color: var(--text);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Headings */
h1 {
    font-size: 1.2rem;
    margin: 0;
    font-weight: 500;
}

h2 {
    display: block;
    position: relative;
    font-size: 1.1rem;
    margin: 0.8rem 0 0;
    padding-bottom: 0.5rem;
    font-weight: 600;
}

/* Link Styling */
a {
    color: var(--link);
    text-decoration: none;
    position: relative;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 0 4px;
    margin: 0 -4px;
    border-radius: 3px;
}

a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--link);
    opacity: 0.15;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
    z-index: -1;
    border-radius: 3px;
}

a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Common List Styling */
ul {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0.8rem;
}

li {
    padding-left: 20px;
    position: relative;
}

li::before {
    content: "→ ";
    position: absolute;
    left: 0;
}

/* Common Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes wiggle {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
    100% { transform: rotate(0deg); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* Badge Styling */
.new-badge {
    color: white;
    border-radius: 4px;
    padding: 1px 4px;
    font-size: 0.7rem;
    margin-left: 4px;
    vertical-align: text-top;
    letter-spacing: 0;
}

/* Animation Utility Class */
.animate-in {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

/* Theme Toggle Styles */
.theme-toggle {
    position: relative;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: var(--section-bg);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    opacity: 0.7;
    width: 32px;
    height: 32px;
    margin-left: auto;
}

.theme-toggle:hover {
    opacity: 1;
}

.theme-toggle svg {
    width: 16px;
    height: 16px;
    fill: var(--text);
}

/* Top Menu Styles */
.top-menu {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.7;
    align-items: center;
    justify-content: flex-start;
    letter-spacing: -0.02em;
    line-height: 24px;
}

.menu-item {
    color: var(--text);
    text-decoration: none;
    transition: opacity 0.2s ease;
    position: relative;
    padding: 0 4px;
    margin: 0;
    font-size: 16px;
    letter-spacing: -0.02em;
    line-height: 24px;
    display: inline-block;
}

/* Disable general 'a::after' background effect for menu items */
.menu-item::after {
    transform: none !important; /* Prevent scaling */
    background-color: var(--text) !important; /* Ensure underline color */
    height: 1px !important; /* Ensure underline height */
    bottom: -2px !important; /* Position underline correctly */
    opacity: 0; /* Start hidden */
    transition: opacity 0.2s ease !important; /* Use opacity transition */
}

/* Original menu-item underline styles (adjusted) */
/* .menu-item::after { */
/*     content: ''; */
/*     position: absolute; */
/*     left: 0; */
/*     width: 100%; */
    /* height: 1px; */ /* Controlled above */
    /* background-color: var(--text); */ /* Controlled above */
    /* opacity: 0; */ /* Controlled above */
    /* transition: opacity 0.2s ease; */ /* Controlled above */
    /* bottom: -2px; */ /* Controlled above */
/* } */

.menu-item:hover::after {
    opacity: 0.5 !important; /* Fade in underline on hover */
}

.menu-item.active {
    color: var(--link);
}

.menu-item.active::after {
    opacity: 0.8;
    background-color: var(--link);
}

.menu-item:hover {
    opacity: 1;
}

/* Theme Text Toggle */
.theme-text {
    font-size: 13px;
    opacity: 0.8;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.theme-text::after {
    display: none;
}

/* Theme Options */
.theme-option {
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.theme-separator {
    opacity: 0.5;
}

/* When light theme is active */
[data-mode="light"] .theme-option.light {
    opacity: 1;
}

/* When dark theme is active */
[data-mode="dark"] .theme-option.dark {
    opacity: 1;
}

/* New Badge in Menu */
.new-badge {
    font-size: 0.55rem;
    color: #ff0000;
    background: transparent;
    border: none;
    margin-left: 2px;
    letter-spacing: 0;
    font-weight: normal;
    position: absolute;
    top: -0.5rem;
    right: -1.5rem;
}

/* Responsive Design */
@media (max-width: 480px) {
    body {
        padding: 0 15px;
        margin: 30px auto;
    }
    
    .top-menu {
        gap: 0.8rem;
        margin-bottom: 1.5rem;
    }
    
    .menu-item {
        font-size: 16px;
    }
    
    .theme-toggle {
        width: 28px;
        height: 28px;
        padding: 5px;
    }
    
    .theme-toggle svg {
        width: 14px;
        height: 14px;
    }
} 