/**
 * Custom styles for Kusum Normoyle Portfolio Theme
 * Includes Light & Dark Mode Support with System Preference Detection
 */

/**
 * Import self-hosted Inter font (complete family)
 * Includes all weights 100-900 in normal and italic styles
 * Remove this line and uncomment Google Fonts line below if fonts aren't installed
 */
@import url('../fonts/inter.css');

/**
 * Fallback to Google Fonts (uncomment if self-hosted fonts not available)
 * Comment out the @import above and uncomment this line:
 */
/* @import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap'); */

/**
 * ==============================================
 * LIGHT MODE (DEFAULT)
 * ==============================================
 */
:root {
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    
    /* Accent Color */
    --accent-color: #00E5AA;
    --accent-color-hover: rgba(0, 229, 170, 0.9);
    --accent-color-rgb: 0, 229, 170;
    
    /* Base Colors - Light Mode */
    --background: #ffffff;
    --foreground: #1a1a1a;
    --text-primary: #000000;
    --text-secondary: #666666;
    --text-muted: #999999;
    
    /* Component Colors */
    --header-bg: rgba(255, 255, 255, 0.95);
    --header-border: rgba(0, 0, 0, 0.1);
    --footer-bg: #ffffff;
    --secondary-footer-bg: #000000;
    --secondary-footer-text: #ffffff;
    
    /* Interactive Elements */
    --border-color: rgba(0, 0, 0, 0.1);
    --hover-overlay: rgba(0, 229, 170, 0.15);
    --input-bg: #f3f3f5;
    --input-border: rgba(0, 0, 0, 0.1);
    --input-text: #000000;
    --input-placeholder: rgba(0, 0, 0, 0.5);
    
    /* Button Colors */
    --button-bg: #000000;
    --button-text: #ffffff;
    --button-hover-bg: var(--accent-color);
    --button-hover-text: #000000;
    
    /* Link Colors */
    --link-color: #000000;
    --link-hover-color: var(--accent-color);
    
    /* Lightbox */
    --lightbox-bg: rgba(0, 0, 0, 0.95);
    --lightbox-nav-bg: #ffffff;
    --lightbox-nav-text: #000000;
}

/**
 * ==============================================
 * DARK MODE (SYSTEM PREFERENCE)
 * Automatically applies when system is set to dark mode
 * ==============================================
 */
@media (prefers-color-scheme: dark) {
    :root:not(.light-mode) {
        /* Base Colors - Dark Mode */
        --background: #0a0a0a;
        --foreground: #ededed;
        --text-primary: #ffffff;
        --text-secondary: #b3b3b3;
        --text-muted: #737373;
        
        /* Component Colors */
        --header-bg: rgba(10, 10, 10, 0.95);
        --header-border: rgba(255, 255, 255, 0.1);
        --footer-bg: #0a0a0a;
        --secondary-footer-bg: #000000;
        --secondary-footer-text: #ededed;
        
        /* Interactive Elements */
        --border-color: rgba(255, 255, 255, 0.1);
        --hover-overlay: rgba(0, 229, 170, 0.2);
        --input-bg: #1a1a1a;
        --input-border: rgba(255, 255, 255, 0.1);
        --input-text: #ffffff;
        --input-placeholder: rgba(255, 255, 255, 0.5);
        
        /* Button Colors */
        --button-bg: #ffffff;
        --button-text: #000000;
        --button-hover-bg: var(--accent-color);
        --button-hover-text: #000000;
        
        /* Link Colors */
        --link-color: #ffffff;
        --link-hover-color: var(--accent-color);
        
        /* Lightbox */
        --lightbox-bg: rgba(0, 0, 0, 0.98);
        --lightbox-nav-bg: #1a1a1a;
        --lightbox-nav-text: #ffffff;
    }
}

/**
 * ==============================================
 * DARK MODE (MANUAL CLASS)
 * For manual dark mode toggle (if implemented)
 * ==============================================
 */
.dark-mode {
    /* Base Colors - Dark Mode */
    --background: #0a0a0a;
    --foreground: #ededed;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #737373;
    
    /* Component Colors */
    --header-bg: rgba(10, 10, 10, 0.95);
    --header-border: rgba(255, 255, 255, 0.1);
    --footer-bg: #0a0a0a;
    --secondary-footer-bg: #000000;
    --secondary-footer-text: #ededed;
    
    /* Interactive Elements */
    --border-color: rgba(255, 255, 255, 0.1);
    --hover-overlay: rgba(0, 229, 170, 0.2);
    --input-bg: #1a1a1a;
    --input-border: rgba(255, 255, 255, 0.1);
    --input-text: #ffffff;
    --input-placeholder: rgba(255, 255, 255, 0.5);
    
    /* Button Colors */
    --button-bg: #ffffff;
    --button-text: #000000;
    --button-hover-bg: var(--accent-color);
    --button-hover-text: #000000;
    
    /* Link Colors */
    --link-color: #ffffff;
    --link-hover-color: var(--accent-color);
    
    /* Lightbox */
    --lightbox-bg: rgba(0, 0, 0, 0.98);
    --lightbox-nav-bg: #1a1a1a;
    --lightbox-nav-text: #ffffff;
}

/**
 * ==============================================
 * BASE STYLES
 * ==============================================
 */
* {
    box-sizing: border-box;
}

html {
    overflow-y: scroll;
}

body {
    font-family: var(--font-family);
    background-color: var(--background);
    color: var(--foreground);
    /* Prevent layout shift from scrollbar */
    overflow-y: scroll;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Remove default link styling */
a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

/**
 * ==============================================
 * HEADER & NAVIGATION
 * ==============================================
 */
/* Custom logo styling */
.custom-logo-link {
    display: flex;
    align-items: center;
}

.custom-logo-link img {
    height: 12px;
    width: auto;
}

/* Navigation menu styling */
nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

nav ul li {
    display: inline-block;
}

nav ul li a {
    color: var(--link-color);
    text-decoration: none;
    transition: opacity 0.3s, color 0.3s;
}

nav ul li a:hover {
    opacity: 0.7;
}

/**
 * ==============================================
 * LINKS & TYPOGRAPHY
 * ==============================================
 */
/* Body link style */
.body-link,
.prose a {
    position: relative;
    text-decoration: none;
    display: inline;
    font-weight: 400;
    color: var(--link-color);
}

.body-link::after,
.prose a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -4px;
    height: 2px;
    background-color: var(--accent-color);
}

/* Custom logo sizing */
.custom-logo {
    height: 12px;
    width: auto;
}

/* Prose customization for content */
.prose {
    max-width: 65ch;
    color: var(--text-secondary);
}

.prose p {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
    line-height: 1.75;
}

.prose h2 {
    margin-top: 2em;
    margin-bottom: 1em;
    color: var(--text-primary);
}

.prose h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: var(--text-primary);
}

/**
 * ==============================================
 * BUTTONS
 * ==============================================
 */
/* Download button styles */
.download-button {
    background-color: var(--button-bg);
    color: var(--button-text);
    padding: 12px 24px;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
    display: inline-block;
    text-decoration: none;
}

.download-button:hover {
    background-color: var(--button-hover-bg);
    color: var(--button-hover-text);
}

.download-button:active {
    opacity: 0.8;
}

/**
 * ==============================================
 * IMAGE EFFECTS
 * ==============================================
 */
/* Image hover overlay */
.image-hover-container {
    position: relative;
    overflow: hidden;
}

.image-hover-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: var(--accent-color);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.image-hover-container:hover::before {
    opacity: 0.15;
}

@media (prefers-color-scheme: dark) {
    :root:not(.light-mode) .image-hover-container:hover::before {
        opacity: 0.2;
    }
}

.dark-mode .image-hover-container:hover::before {
    opacity: 0.2;
}

/* Portfolio title link hover */
.portfolio-title-link {
    transition: color 0.3s ease-in-out;
}

.portfolio-title-link:hover {
    color: var(--accent-color) !important;
}

/**
 * ==============================================
 * LIGHTBOX
 * ==============================================
 */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background-color: var(--lightbox-bg);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--lightbox-nav-bg);
    color: var(--lightbox-nav-text);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s;
}

.lightbox-nav:hover {
    opacity: 0.8;
}

.lightbox-nav-prev {
    left: 24px;
}

.lightbox-nav-next {
    right: 24px;
}

/**
 * ==============================================
 * CONTACT PANEL
 * ==============================================
 */
#contactPanel .contact-input {
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--input-text);
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

#contactPanel .contact-input:focus {
    outline: none;
    border-color: var(--accent-color) !important;
}

#contactPanel .contact-input::placeholder {
    color: var(--input-placeholder);
}

#contactPanel .contact-cancel-btn:hover {
    background: var(--hover-overlay) !important;
}

/* Smooth scrolling for contact panel */
#contactPanel {
    scrollbar-width: thin;
    scrollbar-color: var(--text-muted) transparent;
}

#contactPanel::-webkit-scrollbar {
    width: 6px;
}

#contactPanel::-webkit-scrollbar-track {
    background: transparent;
}

#contactPanel::-webkit-scrollbar-thumb {
    background-color: var(--text-muted);
    border-radius: 3px;
}

#contactPanel::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-secondary);
}

/**
 * ==============================================
 * RESPONSIVE EMBEDS
 * ==============================================
 */
.embed-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
}

.embed-container iframe,
.embed-container object,
.embed-container embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/**
 * ==============================================
 * WORDPRESS ALIGNMENT CLASSES
 * ==============================================
 */
.alignleft {
    float: left;
    margin-right: 1.5em;
    margin-bottom: 1em;
}

.alignright {
    float: right;
    margin-left: 1.5em;
    margin-bottom: 1em;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/**
 * ==============================================
 * WORDPRESS GALLERY
 * ==============================================
 */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.gallery-item {
    overflow: hidden;
    border-radius: 6px;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.2s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/**
 * ==============================================
 * MASONRY GRID LAYOUT
 * ==============================================
 */
.masonry-grid {
    column-count: 1;
    column-gap: 1.5rem;
}

@media (min-width: 640px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (min-width: 1024px) {
    .masonry-grid {
        column-count: 4;
    }
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 17px;
    display: inline-block;
    width: 100%;
}

/**
 * ==============================================
 * COLOR MODE TRANSITION
 * ==============================================
 */
body,
header,
footer,
.prose,
a,
button,
input,
textarea {
    transition: background-color 0.3s ease, 
                color 0.3s ease, 
                border-color 0.3s ease;
}

/**
 * ==============================================
 * DARK MODE SPECIFIC ADJUSTMENTS
 * ==============================================
 */
@media (prefers-color-scheme: dark) {
    :root:not(.light-mode) img {
        opacity: 0.9;
    }
    
    :root:not(.light-mode) img:hover {
        opacity: 1;
    }
}

.dark-mode img {
    opacity: 0.9;
}

.dark-mode img:hover {
    opacity: 1;
}
