/* --- Theme Variables --- */
:root {
    /* Regular Theme (Default) */
    --bg-color: #f0f0f0;
    --panel-bg: #ffffff;
    --border-color: #333;
    --button-bg: #e0e0e0;
    --button-hover: #d0d0d0;
    --accent-1: #4a90e2;
    --accent-2: #4a90e2;
    --accent-3: #50c878;
    --delete-color: #e24a4a;
    --text-color: #000;
    --shadow: 3px 3px 0px rgba(0,0,0,0.2);
    --input-bg: #ffffff;
    --input-text: #000000;
    --calendar-bg: #ffffff;
    --calendar-text: #000000;
    --calendar-hover: #d0d0d0;
    --calendar-selected: #4a90e2;
    --calendar-inactive: #aaaaaa;
    --list-even: #f8f8f8;
}

/* High Contrast Theme */
.theme-high-contrast {
    --bg-color: #ffffff;
    --panel-bg: #ffffff;
    --border-color: #000000;
    --button-bg: #ffffff;
    --button-hover: #000000;
    --accent-1: #000000;
    --accent-2: #000000;
    --accent-3: #000000;
    --delete-color: #000000;
    --text-color: #000000;
    --shadow: 3px 3px 0px #000000;
    --input-bg: #ffffff;
    --input-text: #000000;
    --calendar-bg: #ffffff;
    --calendar-text: #000000;
    --calendar-hover: #000000;
    --calendar-selected: #000000;
    --calendar-inactive: #666666;
    --list-even: #f0f0f0;
}

/* Dark Theme */
.theme-dark {
    --bg-color: #1a1a1a;
    --panel-bg: #2d2d2d;
    --border-color: #404040;
    --button-bg: #404040;
    --button-hover: #505050;
    --accent-1: #4a90e2;
    --accent-2: #5da8ff;
    --accent-3: #50c878;
    --delete-color: #ff6b6b;
    --text-color: #ffffff;
    --shadow: 3px 3px 0px #000000;
    --input-bg: #404040;
    --input-text: #ffffff;
    --calendar-bg: #404040;
    --calendar-text: #ffffff;
    --calendar-hover: #505050;
    --calendar-selected: #4a90e2;
    --calendar-inactive: #666666;
    --list-even: #363636;
}

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

/* Regular Theme */
.intro-container {
    background-image: url('Reviews/Images/Upon a Long Sunset.png');
}

/* Dark Theme */
.theme-dark .intro-container {
    background-image: url('Reviews/Images/Upon a Long Sunset.png');
}

/* High Contrast Theme */
.theme-high-contrast .intro-container {
    background-image: url('Reviews/Images/Upon a Long Sunset.png');
}

body {
    font-family: 'Times New Roman', Times, serif;
    background-color: var(--bg-color);
    padding: 20px;
    color: var(--text-color);
    transition: all 0.3s ease;
}

/* Hidden H1 for SEO */
h1 {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Introduction Container */
.intro-container {
    max-width: 900px;
    margin: 0 auto 20px auto;
    padding: 15px;
    background-color: var(--panel-bg);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow);
    text-align: center;
    font-size: 15px;
    line-height: 1.5;
    transition: all 0.3s ease;
    border-radius: 5px;
}

.intro-container strong {
    color: var(--accent-1);
}

.calculator-window {
    background-color: var(--panel-bg);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow);
    max-width: 1200px;
    margin: 0 auto 30px auto;
    transition: all 0.3s ease;
    border-radius: 5px;
}

.title-bar {
    background: linear-gradient(to right, var(--accent-1) 0%, var(--accent-2) 100%);
    color: white;
    padding: 8px 12px;
    font-weight: bold;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    min-height: 40px;
    border-radius: 5px 5px 0 0;
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    margin-top: 6px;
    height: fit-content;
    position: relative;
    top: 2px;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.theme-icon {
    margin-right: 4px;
}

/* Navigation Bar */
.nav-bar {
    background-color: var(--button-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 12px;
    display: flex;
    gap: 20px;
    transition: all 0.3s ease;
}

.nav-bar a {
    color: var(--accent-1);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.nav-bar a:hover {
    background-color: var(--button-hover);
    text-decoration: underline;
}

.calculator-container {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

.panel {
    background-color: var(--panel-bg);
    border: 2px solid var(--border-color);
    padding: 15px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border-radius: 5px;
}

/* Application Placeholder */
.application-placeholder {
    text-align: center;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.placeholder-content {
    max-width: 500px;
    margin: 0 auto;
}

.placeholder-box {
    width: 100%;
    height: 200px;
    background-color: var(--button-bg);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--calendar-inactive);
    font-style: italic;
}

h3 {
    margin-bottom: 10px;
    font-size: 20px;
    padding-bottom: 5px;
    color: var(--text-color);
    transition: all 0.3s ease;
}

h4 {
    margin: 15px 0 8px 0;
    color: var(--accent-2);
    font-size: 14px;
    transition: all 0.3s ease;
}

/* Buttons */
button, .btn {
    padding: 8px 12px;
    background: var(--button-bg);
    border: 1px solid var(--border-color);
    border-right: 2px solid #555;
    border-bottom: 2px solid #555;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    margin-right: 5px;
    margin-bottom: 5px;
    color: var(--text-color);
    transition: all 0.3s ease;
    border-radius: 3px;
}

button:hover {
    background: var(--button-hover);
}

button:active {
    border: 2px solid #555;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

/* SEO Content Sections */
.seo-sections-container {
    max-width: 1200px;
    margin: 0 auto 30px auto;
}

.seo-section {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border-radius: 5px;
}

.seo-section h2 {
    color: var(--accent-1);
    margin-bottom: 20px;
    padding-bottom: 10px;
    transition: all 0.3s ease;
}

.seo-section h3 {
    color: var(--accent-2);
    margin: 20px 0 12px 0;
    padding-bottom: 8px;
    transition: all 0.3s ease;
}

.seo-section p,
.seo-section ul,
.seo-section ol {
    margin-bottom: 15px;
    line-height: 1.6;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.seo-section ul,
.seo-section ol {
    padding-left: 25px;
}

.seo-section li {
    margin-bottom: 10px;
    color: var(--text-color);
    transition: all 0.3s ease;
}

/* ====================================================================== */
/* UNIFIED PROJECTS GRID - THE FIX */
/* ====================================================================== */

/* Main projects grid container - ONE unified grid */
#projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 0px 0;
}

/* Group titles span ALL columns */
.group-title {
    grid-column: 1 / -1; /* Span all 3 columns */
    color: var(--accent-1);
    font-size: 22px;
    margin: 30px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
    text-align: left;
}

/* First group title doesn't need top margin */
.group-title:first-child {
    margin-top: 0;
}

/* Project items - all flow into the same grid */
.project-item {
    padding: 20px;
    border: 1px solid var(--border-color);
    background-color: var(--panel-bg);
    border-radius: 6px;
    text-align: left;
    height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none !important;
    color: inherit;
}

/* MODIFIED: Update .project-title */
.project-title {
    font-weight: bold;
    color: var(--accent-1);
    text-decoration: none !important;
    display: inline-block;
    margin-bottom: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
}

/* MODIFIED: Update hover state */
.project-item:hover {
    background-color: var(--button-hover);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border-color: var(--accent-1);
    text-decoration: none !important;
}

/* NEW: Change title color on box hover */
.project-item:hover .project-title {
    color: var(--accent-2);
    text-decoration: none !important;
}

.project-description {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 10px;
    flex-grow: 1;
    color: var(--text-color);
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
}

.project-tech {
    font-size: 12px;
    color: var(--calendar-inactive);
    margin-top: 8px;
    font-style: italic;
    transition: all 0.3s ease;
}

/* Hidden states for filtering */
.project-item.hidden {
    display: none;
}

.group-title.hidden {
    display: none;
}

/* ====================================================================== */
/* END UNIFIED PROJECTS GRID */
/* ====================================================================== */

/* Professional Background Section */
.professional-background-section {
    margin-top: 0;
    padding: 20px;
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    box-shadow: var(--shadow);
}

.professional-background-section h3 {
    color: var(--accent-1);
    margin-bottom: 15px;
    font-size: 18px;
}

.professional-background-section p {
    margin-bottom: 12px;
    line-height: 1.5;
}

.professional-background-section ul {
    padding-left: 20px;
}

.professional-background-section li {
    margin-bottom: 8px;
    color: var(--text-color);
}

/* High Contrast Specific Overrides */
.theme-high-contrast .title-bar {
    background: #000000 !important;
    color: #ffffff !important;
}

.theme-high-contrast button:hover {
    background-color: #000000 !important;
    color: #ffffff !important;
}

.theme-high-contrast .nav-bar a:hover {
    background-color: #000000 !important;
    color: #ffffff !important;
}

/* Fix high contrast project hover */
.theme-high-contrast .project-item:hover {
    background-color: #ffffff !important;
    border-color: #000000 !important;
    color: #000000 !important;
}

.theme-high-contrast .project-item:hover .project-title,
.theme-high-contrast .project-item:hover .project-description,
.theme-high-contrast .project-item:hover .project-tech {
    color: #000000 !important;
}

/* Dark Mode Specific Overrides */
.theme-dark .intro-container {
    background-color: #2d2d2d;
}

.theme-dark input[type="text"]::placeholder {
    color: #888;
}

/* Projects Search Styles */
.projects-search-container {
    margin: 20px auto;
    max-width: 500px;
    text-align: center;
}

.projects-search-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    background-color: var(--input-bg);
    color: var(--input-text);
    font-family: inherit;
    font-size: 14px;
    border-radius: 4px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.projects-search-input:focus {
    outline: none;
    border-color: var(--accent-1);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.projects-search-input::placeholder {
    color: var(--calendar-inactive);
}

.projects-search-count {
    margin-top: 8px;
    font-size: 12px;
    color: var(--calendar-inactive);
    font-style: italic;
}

/* Filter Options */
.filter-options {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    background-color: var(--button-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background-color: var(--button-hover);
}

.filter-btn.active {
    background-color: var(--accent-1);
    color: white;
    border-color: var(--accent-1);
}

/* Reviews Section Styles */
.reviews-section-container {
    max-width: 1200px;
    margin: 30px auto;
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    padding: 25px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border-radius: 5px;
}

.reviews-section-container h2 {
    color: var(--accent-1);
    margin-bottom: 15px;
    text-align: center;
    font-size: 28px;
}

.reviews-intro {
    text-align: center;
    margin-bottom: 25px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.reviews-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    flex-grow: 1;
}

.review-item {
    padding: 20px;
    border: 1px solid var(--border-color);
    background-color: var(--panel-bg);
    border-radius: 6px;
    text-align: left;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.review-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Add to existing review styles */
.reviewer-info {
    flex-grow: 1;
}

.review-username {
    font-weight: bold;
    color: var(--accent-1);
    margin-bottom: 4px;
    font-size: 14px;
}

.review-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.review-image {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 15px;
    border: 2px solid var(--border-color);
    flex-shrink: 0;
}

.review-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.review-stars {
    color: #ffc107;
    font-size: 16px;
}

.review-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-color);
    flex-grow: 1;
}

.review-nav-btn {
    background-color: var(--button-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease;
}

.review-nav-btn:hover {
    background-color: var(--button-hover);
    transform: scale(1.1);
}

.reviews-indicator {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.indicator-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--calendar-inactive);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator-dot.active {
    background-color: var(--accent-1);
}

/* Footer Privacy Policy and Copyright - FIXED SECTION */
.footer-container {
    text-align: center;
    padding: 0px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.copyright-footer {
    margin-bottom: 0px;
    color: #666;
}

.privacy-policy-footer {
    font-size: 0.9em;
    display: inline-block;
    margin: 0 10px;
}

.privacy-policy-footer a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    opacity: 0.7;
}

.privacy-policy-footer a:hover {
    text-decoration: underline;
    opacity: 1;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--accent-1);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--accent-2);
    transform: translateY(-3px);
}

/* ====================================================================== */
/* RESPONSIVE DESIGN */
/* ====================================================================== */

/* For tablets and smaller desktops (2 columns) */
@media (max-width: 1200px) {
    #projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .reviews-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* For mobile devices (1 column) */
@media (max-width: 768px) {
    #projects-grid {
        grid-template-columns: 1fr;
    }
    
    .group-title {
        grid-column: 1; /* On mobile, group titles also take 1 column */
    }
    
    .reviews-grid {
        grid-template-columns: 1fr;
    }
    
    .title-bar {
        flex-direction: row; /* Keep items in a row */
        justify-content: space-between; /* Space them out */
        align-items: center; /* Align vertically */
        gap: 8px;
        min-height: 50px; /* Ensure enough height */
    }
    
    .theme-toggle {
        align-self: center; /* Center vertically */
        margin-top: 0; /* Remove top margin */
        position: static; /* Remove positioning */
    }
    
    .nav-bar {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .reviews-container {
        flex-direction: column;
    }
    
    .review-nav-btn {
        order: 2;
        margin-top: 15px;
    }
    
    .privacy-policy-footer {
        margin: 5px 8px;
    }
    
    .filter-options {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-btn {
        width: 80%;
    }
    
    .project-item {
        height: auto;
        min-height: 180px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .intro-container {
        font-size: 14px;
        padding: 12px;
    }
    
    .calculator-container {
        padding: 10px;
        gap: 10px;
    }
    
    .panel {
        padding: 12px;
    }
    
    #projects-grid {
        grid-template-columns: 1fr;
    }
    
    .reviews-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-bar {
        flex-direction: column;
        gap: 8px;
    }
    
    .footer-container {
        gap: 5px;
        padding: 15px 0;
    }
    
    .privacy-policy-footer {
        margin: 3px 5px;
        display: block;
    }
    
    .filter-options {
        gap: 8px;
    }
    
    .filter-btn {
        width: 100%;
        max-width: 200px;
    }
}