/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Light mode colors (default) */
    --primary-color: #353535;
    --secondary-color: #000000;
    --accent-color: #e74c3c;
    --text-color: #1c1c1c;
    --button-color: #979797;
    --background-color: #d7d7d7;
    --card-background: #d7d7d7;
    --border-color: #323232;
    --success-color: #159433;
    --error-color: #dc3545;
    --link-color: #3498db;
    --link-hover: #2980b9;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --particle-color: #000000;
}

/* Dark mode colors */
[data-theme="dark"] {
    --primary-color: #e0e0e0;
    --secondary-color: #ffffff;
    --accent-color: #ff6b6b;
    --text-color: #e0e0e0;
    --button-color: #3a3a3a;
    --background-color: #1a1a1a;
    --card-background: #1a1a1a;
    --border-color: #9d9d9d;
    --success-color: #4caf50;
    --error-color: #f44336;
    --link-color: #64b5f6;
    --link-hover: #42a5f5;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
    --particle-color: #ffffff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--background-color);
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Main content area for landing page */
main {
  position: relative;
  display: flex;
  flex-direction: column;
}

/* ========================================
   PHOTO GALLERY STYLES
   ======================================== */

.gallery-page {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Gallery Info Expander */
.gallery-info-expander {
    background: var(--card-background);
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.gallery-info-expander:hover {
    box-shadow: var(--shadow-md);
}

.expander-toggle {
    width: 100%;
    background: transparent;
    border: none;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
    transition: background 0.2s ease;
}

.expander-toggle:hover {
    background: rgba(52, 152, 219, 0.05);
}

.expander-icon {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
    display: inline-block;
}

.expander-toggle[aria-expanded="true"] .expander-icon {
    transform: rotate(180deg);
}

.expander-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.expander-content.expanded {
    max-height: 2000px;
}

.expander-inner {
    padding: 0 1.5rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.architecture-diagram {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.architecture-diagram img {
    width: 95%;
    height: auto;
}

.gallery-description {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.gallery-description p {
    color: var(--text-color);
    line-height: 1.7;
    font-size: 1.2rem;
    margin: 0;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-description p {
    color: var(--text-color);
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

/* Search Controls */
.search-controls {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 3rem;
    align-items: flex-start;
    flex-wrap: nowrap;
    justify-content: center;
}

.search-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    flex: 0 1 auto;
    width: 250px;
}

.search-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

/* Color Picker - Square Box */
.search-group input[type="color"] {
    width: 60px;
    height: 60px;
    border: 2px solid var(--background-color);
    border-radius: 8px;
    cursor: pointer;
    background: var(--background-color);
    transition: all 0.2s;
}

.search-group input[type="color"]:hover {
    border-color: var(--secondary-color);
    transform: scale(1.05);
}

/* Multiselect Dropdown */
.multiselect-wrapper {
    width: 100%;
}

.multiselect-dropdown {
    position: relative;
    width: 100%;
}

.multiselect-display {
    min-height: 50px;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--background-color);
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    transition: border-color 0.2s;
}

.multiselect-display .placeholder {
    color: var(--text-secondary);
}

.multiselect-options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: var(--background-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin-top: 0.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 100;
}

.multiselect-dropdown.open .multiselect-options {
    display: block;
}

.multiselect-option {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
}

.multiselect-option:hover {
    background: rgba(52, 152, 219, 0.1);
}

.multiselect-option input[type="checkbox"] {
    display: none;
}

.multiselect-option label {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.5rem 0.8rem;
    background: rgba(52, 152, 219, 0.2);
    border: 1px solid rgba(52, 152, 219, 0.3);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.multiselect-option label:hover {
    background: rgba(52, 152, 219, 0.3);
    border-color: rgba(52, 152, 219, 0.5);
}

.multiselect-option input[type="checkbox"]:checked + label {
    background: rgba(52, 152, 219, 0.4);
    border-color: rgba(52, 152, 219, 0.6);
    font-weight: 600;
}

.multiselect-option .label-name {
    font-weight: 500;
}

.multiselect-option .label-count {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.selected-label-tag {
    display: inline-block;
    padding: 0.35rem 0.7rem;
    background: rgba(52, 152, 219, 0.2);
    border: 1px solid rgba(52, 152, 219, 0.3);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-color);
}

/* Buttons */
.search-buttons {
    justify-content: flex-start;
}

.search-btn,
.reset-btn {
    padding: 0.75rem 2rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    background: var(--button-color);
    color: var(--text-color);
}

.search-btn:hover,
.reset-btn:hover {
    opacity: 0.8;
}

.gallery-container {
    position: relative;
}

/* Photo Grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Photo Card */
.photo-card {
    position: relative;
    display: block;
    text-decoration: none;
    overflow: hidden;
    border-radius: 12px;
    background: var(--card-background);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    aspect-ratio: 4/3;
}

.photo-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.photo-card:hover img {
    transform: scale(1.1);
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-color);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.load-more-trigger {
    height: 100px;
    width: 100%;
}

/* Responsive Grid */
@media (max-width: 1200px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 1024px) {
    .search-controls {
        flex-wrap: wrap;
        gap: 2rem;
    }

    .search-group {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }

    .gallery-page {
        padding: 1.5rem 0.75rem;
    }

    .search-controls {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .search-group {
        width: 100%;
    }

    .multiselect-options {
        max-height: 250px;
    }

    .page-header {
        margin-bottom: 2rem;
    }
}

@media (max-width: 480px) {
    .photo-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

/* GLightbox Info Panel - Bottom Slide Up */
.ginfo-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 99999999;
    color: white;
    font-size: 24px;
    font-weight: 600;
    font-family: Georgia, serif;
}

.ginfo-button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.gdownload-button {
    position: fixed;
    bottom: 20px;
    right: 80px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 99999999;
    color: white;
    font-size: 28px;
    font-weight: 600;
}

.gdownload-button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.gdownload-menu {
    position: fixed;
    bottom: -100%;
    right: 20px;
    width: 300px;
    max-height: 400px;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    z-index: 99999998;
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: #e0e0e0;
    overflow-y: auto;
}

.gdownload-menu.active {
    bottom: 80px;
}

.download-menu-header {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #e0e0e0;
}

.download-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.download-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.download-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(-2px);
}

.download-label {
    font-weight: 500;
    color: #e0e0e0;
}

.download-size {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.download-loading,
.download-error {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.6);
}

.ginfo-panel {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    max-height: 60vh;
    background: rgba(20, 20, 20, 0.97);
    backdrop-filter: blur(30px);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99999998;
    overflow-y: auto;
    padding: 30px;
    color: white;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}

.ginfo-panel.active {
    bottom: 0;
}

/* Panel content layout - horizontal sections */
.ginfo-panel-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.ginfo-panel h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: white;
    grid-column: 1 / -1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 0.75rem;
}

.ginfo-panel .info-section {
    margin-bottom: 0;
}

.ginfo-panel .info-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.ginfo-panel .info-content {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

.ginfo-panel .location-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.95rem;
}

.ginfo-panel .labels-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ginfo-panel .label-tag {
    padding: 0.4rem 0.8rem;
    background: rgba(52, 152, 219, 0.2);
    border: 1px solid rgba(52, 152, 219, 0.3);
    border-radius: 6px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.95);
}

.ginfo-panel .colors-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.ginfo-panel .color-swatch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ginfo-panel .color-box {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ginfo-panel .color-name {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Camera/EXIF Info */
.ginfo-panel .camera-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ginfo-panel .exif-item {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
}

.ginfo-panel .exif-item strong {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

/* Updated color swatch with percentage */
.ginfo-panel .color-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.ginfo-panel .color-percent {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: 0.3s;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #00ff00;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

.toggle-label {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    user-select: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .ginfo-panel {
        width: 100%;
        right: -100%;
    }

    .ginfo-button {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .gdownload-button {
        top: 15px;
        right: 65px;
        width: 40px;
        height: 40px;
        font-size: 22px;
    }

    .gdownload-menu {
        width: 90%;
        max-width: 350px;
        right: 5%;
    }

    .gdownload-menu.active {
        bottom: 20px;
    }
}

/* Navigation */
.navbar {
    background: transparent;
    padding: 1rem 0;
    position: relative;
    top: 0;
    z-index: 1000;
    justify-self: center;
}

.navbar .container {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    max-width: 750px;
    background: rgba(255, 255, 255, 0);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    border: 1px solid rgba(0, 0, 0, 0.5);
    border-radius: 16px;
    padding: 0.75rem 1.5rem;
    box-shadow: var(--shadow-lg);
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    white-space: nowrap;
}

.nav-link:hover {
    background-color: rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    text-decoration: none;
}

.nav-link.active {
    background-color: rgba(0, 0, 0, 0.15);
    font-weight: 600;
}

/* Navbar responsive */
@media (max-width: 768px) {
    .navbar .container {
        gap: 0.5rem;
        padding: 0.5rem 1rem;
        max-width: calc(100% - 1rem);
        margin: 0 1rem;
    }

    .nav-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.9rem;
    }
}

/* If user has very thin device, we stack navbar elements */
@media (max-width: 600px) {
    .navbar .container {
        flex-wrap: wrap;
        gap: 0.4rem;
        padding: 0.5rem 0.75rem;
        justify-content: center;
    }

    .nav-link {
        padding: 0.35rem 0.5rem;
        font-size: 0.85rem;
    }

    /* Keep theme toggle on same visual level */
    .theme-toggle {
        order: 10;
    }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Typography */
h1, h2, h3, h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.page-title {
    font-size: 3rem;
    margin: 2rem 0 1rem;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    letter-spacing: -1px;
}

/* Landing page title - smaller margin */
body.landing-page .page-title {
    margin: 0.5rem 0;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--link-color);
    text-decoration: none;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Images */
.hero {
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
}

.hero-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.hero:hover .hero-image {
    transform: scale(1.02);
}

.centered-gif {
    display: block;
    margin: 2rem auto;
    max-width: 100%;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.image-caption {
    text-align: center;
    font-style: italic;
    color: var(--text-color);
    margin-top: 0.75rem;
    font-size: 0.875rem;
    font-weight: 400;
}

/* Profile Section */
.profile-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    align-items: start;
}

.profile-image-container {
    text-align: center;
    position: relative;
}

.profile-image {
    width: 100%;
    border-radius: 16px;
}

.profile-text p {
    margin-bottom: 0.5em;
    font-size: 1.05rem;
    line-height: 1.8;
}

.profile-text p:first-child {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--primary-color);
}

/* Sections */
section {
    margin-bottom: 3rem;
    background: var(--card-background);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Landing page profile section with blur effect */
.profile {
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
    max-width: 900px;
    background: rgba(255, 255, 255, 0);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    border: 1px solid var(--border-color);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    margin-top: 100px;
}

/* Mobile responsive for profile */
@media (max-width: 900px) {
    .profile {
        margin-left: 1rem;
        margin-right: 1rem;
        max-width: calc(100% - 2rem);
    }
}

/* Social Links */
.social-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--card-background);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.social-link:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--secondary-color);
    text-decoration: none;
}

.social-link svg {
    width: 24px;
    height: 24px;
    fill: var(--text-color);
    transition: fill 0.3s ease;
}

.social-link:hover svg {
    fill: var(--secondary-color);
}

.social-link span {
    font-size: 1rem;
}

/* Responsive social links */
@media (max-width: 768px) {
    .social-links {
        gap: 1rem;
    }

    .social-link {
        padding: 0.6rem 1.2rem;
        font-size: 0.95rem;
    }

    .social-link svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .social-links {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .social-link {
        justify-content: center;
    }
}

.intro h2 {
    text-align: center;
    color: var(--text-color);
    font-size: 1.75rem;
    margin-bottom: 1.25rem;
}

.intro p {
    font-size: 1.05rem;
    color: var(--text-color);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Gallery page specific intro styles */
.gallery-page .intro {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin-bottom: 2rem;
}

.gallery-page .intro p:first-child {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    max-width: 100%;
}

.gallery-page .intro p:not(:first-child) {
    max-width: 40%;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

/* Responsive adjustments for intro */
@media (max-width: 1200px) {
    .gallery-page .intro p:not(:first-child) {
        max-width: 50%;
    }
}

@media (max-width: 768px) {
    .gallery-page .intro p:not(:first-child) {
        max-width: 80%;
    }
}

.blog-content {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.blog-content blockquote {
    border-left: 4px solid var(--secondary-color);
    padding-left: 1.5rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-color);
    background-color: rgba(52, 152, 219, 0.05);
    border-radius: 0 8px 8px 0;
}

.blog-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.blog-content h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

/* Form Styles */
.form-container {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--primary-color);
}

.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: white;
}

.form-group input[type="text"]:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.help-text {
    font-size: 0.875rem;
    color: var(--primary-color);
    margin-top: 0.5rem;
}

.submit-btn {
    width: 100%;
    padding: 1rem;
    background: var(--button-color);
    color: var(--text-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.submit-btn:hover {
    opacity: 0.8;
}

.submit-btn:disabled {
    background: var(--background-color);
    cursor: not-allowed;
    transform: none;
}

/* Messages */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
    margin: 1rem 0;
}

.loading-message {
    text-align: center;
    padding: 2rem;
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--secondary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 1rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Results */
.results {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: var(--background-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.results h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.explanation {
    text-align: center;
    padding: 1rem;
    background: var(--background-color);
    border-radius: 4px;
    margin: 1rem 0;
    font-size: 1.1rem;
    line-height: 1.8;
}

.explanation mark {
    padding: 0.1rem 0.2rem;
    border-radius: 2px;
}

.results table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.results th,
.results td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.results th {
    background-color: var(--background-color);
    color: var(--text-color);
    font-weight: 500;
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2c3e50 100%);
    color: white;
    padding: 3rem 0 2rem;
    margin-top: 6rem;
    text-align: center;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
}

footer p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

/* Two Column Layout */
.two-column-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.two-column-layout section {
    margin-bottom: 0;
}

.form-container {
    max-width: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
    .profile-content {
        grid-template-columns: 1fr;
    }

    .two-column-layout {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .two-column-layout section {
        margin-bottom: 0;
    }

    .two-column-layout section:last-child {
        margin-bottom: 0;
    }

    .page-title {
        font-size: 2rem;
    }

    .container {
        padding: 1rem;
    }

    section {
        padding: 1rem;
    }
}

/* Prediction Box */
.prediction-box {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.05) 0%, rgba(52, 152, 219, 0.02) 100%);
    border: 2px solid var(--secondary-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: var(--shadow-sm);
}

.prediction-box p {
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

.prediction-label {
    font-weight: 700;
    color: var(--secondary-color);
    text-transform: capitalize;
    font-size: 1.2rem;
}

/* Particles animation */
#particles-js{
  position: fixed;
  width: 100%;
  height: 100vh;
  background-color: var(--background-color);
  background-size: cover;
  background-position: 50% 50%;
  background-repeat: no-repeat;
  z-index: -1;
  transition: background-color 0.3s ease;
}

/* Theme toggle button - integrated into navbar */
.theme-toggle {
  position: relative;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all 0.3s ease;
  color: var(--text-color);
  border-radius: 6px;
  padding: 0.5rem;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background-color: rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.theme-toggle:active {
  transform: scale(0.95);
}

/* Ensure SVG icon is properly sized */
.theme-toggle svg {
  width: 1.3em;
  height: 1.3em;
}

/* Responsive theme toggle */
@media (max-width: 768px) {
  .theme-toggle {
    width: 36px;
    height: 36px;
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .theme-toggle {
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
    padding: 0.3rem;
  }
}

/* Scrollable particles wrapper for other pages */
.particles-wrapper {
  position: relative;
  min-height: 100vh;
}

.particles-wrapper #particles-js {
  position: absolute;
  height: 100%;
  min-height: 100vh;
}

/* ========================================
   COUNTERFACTUAL ANIMATION
   ======================================== */

.counterfactual-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    gap: 1.5rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--card-background);
    border-radius: 12px;
    max-width: 900px;
    margin: 0 auto;
}

.prediction-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.prediction-text {
    color: var(--text-color);
}

.prediction-value {
    padding: 0.2em 0.5em;
    border-radius: 4px;
    animation: predictionChange 8s infinite;
    position: relative;
    min-width: 5em;
    display: inline-block;
}

.prediction-value.negative::before {
    content: "Negative";
    animation: predictionTextChange 8s infinite;
}

.prediction-value.negative {
    background-color: rgba(239, 68, 68, 0.3);
    color: var(--text-color);
}

@keyframes predictionTextChange {
    0%, 65% {
        content: "Negative";
    }
    70%, 100% {
        content: "Positive";
    }
}

.prediction-icon {
    color: var(--text-color);
    transition: color 0.3s ease;
}

.icon-sad-mouth {
    animation: sadMouthFade 8s infinite;
}

.icon-happy-mouth {
    animation: happyMouthFade 8s infinite;
}

@keyframes sadMouthFade {
    0%, 65% {
        opacity: 1;
    }
    70%, 100% {
        opacity: 0;
    }
}

@keyframes happyMouthFade {
    0%, 65% {
        opacity: 0;
    }
    70%, 100% {
        opacity: 1;
    }
}

.sentence-line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em;
    justify-content: center;
    align-items: center;
}

.word {
    padding: 0.2em 0.4em;
    border-radius: 4px;
    transition: background-color 0.5s ease;
}

/* SHAP-like highlighting colors */
.light-red {
    background-color: rgba(232, 111, 111, 0.3);
}

.dark-red {
    background-color: rgba(214, 10, 10, 0.5);
}

.light-grey {
    background-color: rgba(156, 163, 175, 0.3);
}

.light-green {
    background-color: rgba(99, 216, 142, 0.3);
}

.dark-green {
    background-color: rgba(7, 163, 64, 0.5);
}

.word-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 6em;
    min-height: 1.6em;
}

.word-container .word {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

.floating-word {
    animation: floatUp 8s infinite;
}

.mask-word {
    opacity: 0;
    animation: maskAppear 8s infinite;
}

.replacement-word {
    opacity: 0;
    animation: replacementAppear 8s infinite;
}

/* Animation keyframes */
@keyframes floatUp {
    0%, 15% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    25% {
        opacity: 0;
        transform: translate(-50%, -2em);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -2em);
    }
}

@keyframes maskAppear {
    0%, 25% {
        opacity: 0;
        transform: translate(-50%, 2em);
    }
    30% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    50%, 55% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    60% {
        opacity: 0;
        transform: translate(-50%, -2em);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -2em);
    }
}

@keyframes replacementAppear {
    0%, 60% {
        opacity: 0;
        transform: translate(-50%, 2em);
    }
    65% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes predictionChange {
    0%, 65% {
        background-color: rgba(239, 68, 68, 0.3);
    }
    70%, 100% {
        background-color: rgba(34, 197, 94, 0.3);
    }
}


/* Update text colors for changing words */
.sentence-line .word.light-red {
    animation: wordColorChange 8s infinite;
}

@keyframes wordColorChange {
    0%, 65% {
        background-color: rgba(239, 68, 68, 0.3);
    }
    70%, 100% {
        background-color: rgba(34, 197, 94, 0.3);
    }
}

/* Responsive font sizing */
@media (max-width: 768px) {
    .counterfactual-animation {
        padding: 2rem 1rem;
        font-size: clamp(1rem, 4vw, 1.5rem);
    }
}

@media (max-width: 480px) {
    .counterfactual-animation {
        padding: 1.5rem 0.75rem;
        font-size: clamp(0.9rem, 4.5vw, 1.3rem);
        gap: 1rem;
    }

    .sentence-line {
        gap: 0.3em;
    }
}
