:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #ec4899;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-lg: 1rem;
    --radius-md: 0.5rem;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
}

/* Header & Nav */
header {
    width: 100%;
    max-width: 1200px;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 10; /* Lower z-index for logo */
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo .icon {
    font-size: 1.8rem;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
    z-index: 1100; /* Higher than nav drawer */
}

.hamburger .bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-main);
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

/* Hamburger Animation when Active */
.hamburger.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

nav a {
    color: var(--text-main);
    font-weight: 500;
}

nav a:hover {
    color: var(--primary);
}

.lang-btn {
    background: none;
    border: 1px solid var(--border);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.lang-btn:hover {
    background-color: #f1f5f9;
    border-color: var(--primary);
    color: var(--primary);
}

/* Main Layout */
main {
    width: 100%;
    max-width: 1200px;
    padding: 2rem 1.5rem 4rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4rem;
}

/* Hero Section */
.hero {
    text-align: center;
    max-width: 800px;
    margin-bottom: 2rem;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.tagline {
    color: var(--text-muted);
    font-size: 1.2rem;
}

/* Upload Section */
#upload-section {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.upload-zone {
    width: 100%;
    min-height: 300px;
    border: 3px dashed var(--border);
    border-radius: var(--radius-lg);
    background-color: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-zone:hover, .upload-zone.drag-over {
    border-color: var(--primary);
    background-color: #eef2ff;
}

.upload-content {
    text-align: center;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.upload-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.upload-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.preview-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background-color: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.2s, background-color 0.2s;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-action {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 1rem 3rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow-md);
}

.btn-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-action:not(:disabled):hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.btn-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: rgba(0,0,0,0.8);
}

/* Results Section */
#results-section {
    width: 100%;
}

.results-header {
    text-align: center;
    margin-bottom: 2rem;
}

.highlight {
    color: var(--secondary);
    text-decoration: underline;
    text-decoration-thickness: 3px;
    text-underline-offset: 4px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.idea-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
}

.idea-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 1.5rem;
    background-color: #fff;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.easy { background-color: #dcfce7; color: #166534; }
.badge.medium { background-color: #fef9c3; color: #854d0e; }
.badge.hard { background-color: #fee2e2; color: #991b1b; }

.card-type {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    display: block;
}

.card-title {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
}

.card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.btn-save.saved {
    color: var(--secondary);
}

.btn-share {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: #cbd5e1;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: auto; /* Push save button to right if using flex space-between, or use gap */
}

.btn-share:hover {
    color: var(--primary);
    transform: scale(1.1);
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between; /* Share on left, Save on right */
    background-color: #fafafa;
    align-items: center;
}

.card-description {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.tools-section h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.tools-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tool-tag {
    background-color: #f1f5f9;
    color: var(--text-muted);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Info & Gallery Sections */
.info-section {
    width: 100%;
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
}

.info-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.info-section p {
    max-width: 700px;
    margin: 0 auto 1.5rem;
    color: var(--text-muted);
}

/* --- Gallery Grid Improvement --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    text-align: left;
}

.gallery-item {
    background: var(--surface);
    border-radius: var(--radius-lg); /* More rounded */
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.gallery-img-placeholder {
    width: 100%;
    height: 180px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #cbd5e1;
    border-bottom: 1px solid var(--border);
}

.gallery-content {
    padding: 1.5rem;
}

.gallery-item h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-weight: 700;
}

.gallery-item p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

/* --- Filter Bar (New) --- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
}

.filter-btn {
    background: none;
    border: 1px solid var(--border);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover, .filter-btn.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* --- Featured Project (New) --- */
.featured-section {
    width: 100%;
    max-width: 1000px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin-bottom: 4rem;
    box-shadow: var(--shadow-lg);
}

.featured-content {
    padding: 2.5rem;
    flex: 1;
}

.featured-tag {
    background-color: var(--secondary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 1rem;
}

.featured-section h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: white;
}

.featured-section p {
    color: #cbd5e1;
    font-size: 1.1rem;
    max-width: 600px;
    margin-bottom: 2rem;
}

/* --- Timeline Styles (How it Works) --- */
.timeline-section {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    padding: 2rem 0;
}

.timeline-item {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 3rem;
    text-align: left;
    position: relative;
}

/* Connecting Line */
.timeline-section::before {
    content: '';
    position: absolute;
    top: 2rem;
    bottom: 0;
    left: 2rem; /* Center of the icon circle */
    width: 2px;
    background-color: var(--border);
    z-index: 0;
}

.timeline-icon-box {
    width: 4rem;
    height: 4rem;
    background-color: var(--surface);
    border: 2px solid var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 1;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.timeline-content {
    background-color: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    flex: 1;
}

.timeline-content h3 {
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.timeline-content p {
    margin-bottom: 0 !important; /* Override general p styles */
}

/* --- Tips Section Styles --- */
.tips-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    text-align: left;
}

.tip-card {
    background-color: #f0fdf4; /* Light green for tips */
    border: 1px solid #bbf7d0;
    padding: 1.5rem;
    border-radius: var(--radius-md);
}

.tip-card h4 {
    color: #15803d;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tip-card p {
    font-size: 0.9rem;
    margin: 0 !important;
    color: #166534;
}

/* --- FAQ Styles --- */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}

.faq-item {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    text-align: left;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
}

.faq-question:hover {
    background-color: #f8fafc;
}

.faq-toggle {
    transition: transform 0.3s;
}

.faq-item.active .faq-toggle {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.faq-item.active .faq-answer {
    padding: 0 1.5rem 1.5rem;
    max-height: 200px; /* Arbitrary large height */
}


/* Legal Pages Styling */
.text-page {
    max-width: 800px;
    align-items: flex-start;
}

.text-page h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.text-page section {
    margin-bottom: 2rem;
    width: 100%;
}

.text-page h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.text-page p, .text-page ul {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.text-page ul {
    padding-left: 1.5rem;
}

/* Footer */
footer {
    width: 100%;
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
    margin-top: auto;
}

footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--primary);
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

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

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

.hidden {
    display: none !important;
}

/* Community Section */
.community-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
    width: 100%;
}

.comm-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s;
}

.comm-card:hover {
    transform: translateY(-5px);
}

.comm-images {
    display: flex;
    height: 200px;
    position: relative;
    border-bottom: 1px solid var(--border);
}

.comm-img-box {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.comm-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img-label {
    position: absolute;
    bottom: 5px;
    left: 5px;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.comm-body {
    padding: 1.25rem;
}

.comm-user {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.comm-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.comm-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
}

.btn-like {
    display: none;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

/* Language Switching for Static Pages */
.lang-en-content, .lang-ko-content { display: none !important; }
html[data-lang="en"] .lang-en-content { display: block !important; }
html[data-lang="ko"] .lang-ko-content { display: block !important; }

/* Responsive & Mobile Optimization */

@media (max-width: 768px) {

    /* Header & Nav */

    header {

        padding: 1rem 1.5rem;

    }

    

    .hamburger {

        display: flex;

    }



                nav {



                    position: fixed;



                    top: 0;



                    right: -100%; /* Hidden by default */



                    width: 100%;



                    height: 100vh;



                    background-color: var(--surface);



                    flex-direction: column;



                    justify-content: flex-start;



                    padding-top: 6rem;



                    transition: right 0.3s ease-in-out;



                    box-shadow: -5px 0 15px rgba(0,0,0,0.1);



                    z-index: 1000; /* Higher than logo */



                }



        



    



    nav.active {

        right: 0; /* Slide in */

    }



    nav ul {

        flex-direction: column;

        gap: 2rem;

        width: 100%;

        text-align: center;

    }



    nav a {

        font-size: 1.25rem;

        display: block;

        padding: 0.5rem;

    }



    .lang-btn {

        font-size: 1.1rem;

        padding: 0.5rem 1rem;

    }



    /* Main Layout Adjustment */

    main {

        padding: 1.5rem 1rem 3rem;

        gap: 2.5rem;

    }



    .hero h2 {

        font-size: 1.75rem;

        padding: 0 0.5rem;

    }



    .tagline {

        font-size: 1rem;

        padding: 0 1rem;

    }



    /* Upload Zone Touch Friendly */

    .upload-zone {

        min-height: 220px;

    }



    .upload-content {

        padding: 1.5rem;

    }



    .upload-icon {

        font-size: 3rem;

    }



    /* Buttons: Full width for easy tapping */

    .btn-action {

        width: 100%;

        padding: 1rem;

        font-size: 1.1rem;

    }



    .btn-primary {

        /* Keep upload button auto width inside zone, but larger tap area */

        padding: 0.8rem 2rem;

    }



    /* Cards: Single Column */

    .cards-grid, .gallery-grid {

        grid-template-columns: 1fr;

        gap: 1.5rem;

    }



    .idea-card:hover, .gallery-item:hover {

        transform: none; /* Disable hover lift on touch devices */

        box-shadow: var(--shadow-md);

    }



    /* Card Actions */

    .card-footer {

        padding: 1rem;

    }

    

    .btn-share, .btn-save {

        font-size: 1.2rem; /* Larger icons */

        padding: 0.5rem; /* Larger tap target */

    }

    /* Timeline Mobile */
    .timeline-section::before {
        left: 1.5rem; /* Adjust line position */
    }

    .timeline-icon-box {
        width: 3rem;
        height: 3rem;
        font-size: 1.2rem;
    }

    .timeline-item {
        gap: 1rem;
    }

    .timeline-content {
        padding: 1rem;
    }


    /* Footer */

    footer {

        padding: 2rem 1rem;

    }



    .footer-links {

        flex-direction: column;

        gap: 1rem;

    }

    /* Featured Mobile */
    .featured-section {
        border-radius: 0; /* Full width on mobile often looks better squared off or keep rounded if margins exist */
    }
    
    .featured-content {
        padding: 1.5rem;
    }

}
