/* --- Google Font Import --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');

/* --- CSS Variables for Easy Themeing --- */
:root {
    --primary-blue: #2c3e50;
    --secondary-blue: #34495e;
    --accent-color: #3498db;
    --background-light: #f4f6f9;
    --text-light: #ecf0f1;
    --text-dark: #333;
    --card-background: #ffffff;
    --border-color: #dfe4ea;
    --success-color: #2ecc71;
    --error-color: #e74c3c;
    --shadow-color: rgba(0, 0, 0, 0.05);
}

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

@keyframes glow {
    0% {
        box-shadow: 0 0 5px var(--accent-color), 0 0 10px var(--accent-color);
    }
    50% {
        box-shadow: 0 0 20px var(--accent-color), 0 0 30px var(--accent-color);
    }
    100% {
        box-shadow: 0 0 5px var(--accent-color), 0 0 10px var(--accent-color);
    }
}

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


/* --- General Body and Typography Styles --- */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-light);
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, h4 {
    color: var(--primary-blue);
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    text-decoration: underline;
}

/* --- Main Layout: Header, Main, Footer --- */
header.main-header {
    background-color: var(--card-background);
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px var(--shadow-color);
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-container img {
    width: 90px; 
    height: 90px;
    margin-right: 15px;
}

.logo-container .title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
}

nav.main-nav a {
    color: var(--primary-blue);
    margin-left: 20px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

nav.main-nav a:hover {
    background-color: var(--background-light);
    text-decoration: none;
}

main.content-wrapper {
    flex-grow: 1;
    width: 100%;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    box-sizing: border-box;
}

footer.main-footer {
    text-align: center;
    padding: 20px;
    background-color: var(--card-background);
    color: #7f8c8d;
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

/* --- Card and Container Styles --- */
.content-card {
    background-color: var(--card-background);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow-color);
    animation: fadeIn 0.5s ease-in-out;
}

.content-card h2 {
    margin-top: 0;
}

/* --- Form and Button Styles --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 6px;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #27ae60;
}

.btn-glow {
    animation: glow 3s infinite;
}

.btn-secondary {
    background-color: #ecf0f1;
    color: var(--primary-blue);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: #dfe4ea;
    border-color: #bdc3c7;
}

/* --- Flash Messages --- */
.flash-messages {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.flash-messages li {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    border: 1px solid transparent;
}

.flash-messages .success, .flash-messages .message {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.flash-messages .danger, .flash-messages .error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.flash-messages .info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* --- Index Page Specifics --- */
.dashboard-header {
    margin-bottom: 30px;
}

.dashboard-header h1 {
    font-size: 2rem;
    margin: 0;
}

.dashboard-header p {
    font-size: 1.1rem;
    color: #7f8c8d;
    margin-top: 5px;
}

.credits-display {
    background-color: var(--background-light);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 30px;
}

.credits-display .label {
    font-size: 1rem;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.credits-display .count {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* --- Split Container for Login/Register pages --- */
.split-container {
    display: flex;
    width: 100%;
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow-color);
    overflow: hidden;
    animation: fadeIn 0.5s ease-in-out;
}

.split-container .form-pane {
    flex: 1;
    padding: 50px;
    min-width: 300px;
}

.split-container .info-pane {
    flex: 1;
    background-color: var(--primary-blue);
    color: var(--text-light);
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.info-pane h2 {
    color: white;
    font-size: 2rem;
    margin-bottom: 20px;
}

.info-pane p, .info-pane ul {
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: 0.9;
}

.info-pane ul {
    list-style: none;
    padding-left: 0;
    margin-top: 20px;
}

.info-pane ul li {
    padding-left: 30px;
    position: relative;
    margin-bottom: 15px;
}

.info-pane ul li::before {
    content: '✔';
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

/* --- Upload Page Styles --- */
.upload-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.drop-zone {
    width: 100%;
    max-width: 600px;
    border: 3px dashed var(--border-color);
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.drop-zone.drag-over {
    border-color: var(--accent-color);
    background-color: #eaf5fc;
}

.drop-zone .upload-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 20px;
    color: var(--border-color);
    transition: color 0.3s ease;
}

.drop-zone:hover .upload-icon {
    color: var(--accent-color);
}

.drop-zone-text {
    font-size: 1.2rem;
    color: #7f8c8d;
    margin: 0;
}

.drop-zone-text strong {
    color: var(--accent-color);
}

.drop-zone .file-info {
    font-size: 1.1rem;
    margin-top: 20px;
    font-weight: 500;
}

.drop-zone input[type="file"] {
    display: none;
}

.instructions-pane {
    width: 100%;
    max-width: 800px;
    margin-top: 20px;
    padding: 30px;
    background-color: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.instructions-pane h3 {
    margin-top: 0;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.instructions-pane ul {
    list-style: none;
    padding-left: 0;
}

.instructions-pane ul li {
    margin-bottom: 10px;
    padding-left: 25px;
    position: relative;
}

.instructions-pane ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

.instructions-pane .note {
    margin-top: 20px;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.instructions-pane .note strong {
    color: var(--primary-blue);
}

/* --- Pricing Page Styles --- */
.pricing-header {
    text-align: center;
    margin-bottom: 40px;
}

.pricing-header .tagline {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--accent-color);
    background-color: rgba(52, 152, 219, 0.1);
    display: inline-block;
    padding: 8px 15px;
    border-radius: 20px;
}

.pricing-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.pricing-card {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.pricing-card .title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 10px 0;
}

.pricing-card .price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 20px;
}

.pricing-card .price span.currency {
    font-size: 1rem;
    font-weight: 500;
    vertical-align: super;
}

.pricing-card .description {
    color: #7f8c8d;
    margin-bottom: 30px;
    flex-grow: 1;
}

.pricing-card .btn {
    width: 100%;
}

/* --- Convert Page Styles --- */
.preview-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 30px auto;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: aspect-ratio 0.4s ease;
}

.preview-container.aspect-flat { aspect-ratio: 1.85 / 1; }
.preview-container.aspect-scope { aspect-ratio: 2.39 / 1; }
.preview-container img {
    width: 100%;
    height: 100%;
    object-fit: contain; 
}

.options-pane {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}

.option-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
}

.option-card {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.option-card:hover {
    border-color: var(--accent-color);
    background-color: #f8f9fa;
}

.option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option-card label {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    padding: 20px;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.option-card input[type="radio"]:checked + label {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--accent-color);
    background-color: #eaf5fc;
}
.option-card input[type="radio"]:checked + label::after {
    content: '✔';
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    color: var(--success-color);
}

.card-content .icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--primary-blue);
}

.card-content .title {
    font-size: 1.2rem;
    font-weight: 700;
}

.card-content .description {
    font-size: 0.9rem;
    color: #7f8c8d;
}


/* --- Loader Overlay Styles --- */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000;
    color: white;
}

.loader-spinner {
    border: 8px solid rgba(255, 255, 255, 0.3);
    border-top: 8px solid var(--accent-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loader-overlay h3 {
    color: white;
}

/* --- Download Card Styles --- */
.download-card {
    background-color: #eaf5fc;
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
}

.download-card h3 {
    margin-top: 0;
}

.download-card .btn {
    font-size: 1.2rem;
    padding: 15px 30px;
}

.download-instructions {
    margin-top: 30px;
    text-align: left;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.download-instructions h4 {
    margin-top: 0;
}

.download-instructions ol {
    padding-left: 20px;
    line-height: 1.6;
}

/* --- FAQ Page Styles --- */
.faq-header {
    text-align: center;
    margin-bottom: 40px;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid var(--border-color);
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 20px;
    font-size: 1.2rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--primary-blue);
}

.faq-question:hover {
    background-color: var(--background-light);
}

.faq-question::after {
    content: '▼';
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.faq-question.active::after {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    padding: 0 20px;
    line-height: 1.7;
}

.faq-answer p {
    margin: 0;
}

/* --- Store Page Styles --- */
.store-hero {
    background-color: var(--primary-blue);
    color: white;
    padding: 60px 40px;
    text-align: center;
    border-radius: 12px;
    margin-bottom: 40px;
    background-image: linear-gradient(rgba(44, 62, 80, 0.8), rgba(44, 62, 80, 0.8)), url('https://www.transparenttextures.com/patterns/cubes.png');
}

.store-hero h1 {
    color: white;
    font-size: 2.5rem;
    margin: 0;
}

.store-hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 10px auto 0 auto;
}


.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.product-card {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative; /* Needed for the banner positioning */
    overflow: visible; /* Allows banner to stick out */
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: var(--background-light);
}

.product-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 10px 0;
}

.product-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    font-size: 0.95rem;
    color: #7f8c8d;
    text-align: left;
    flex-grow: 1;
}

.product-features li {
    padding-left: 20px;
    position: relative;
    margin-bottom: 8px;
}

.product-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success-color);
}

/* NEW: Styles for the featured product card */
.featured-product {
    border-color: var(--accent-color);
    box-shadow: 0 8px 30px rgba(52, 152, 219, 0.2);
}

.featured-banner {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--accent-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
}

.product-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 20px;
}

.product-card .btn {
    width: 100%;
}

/* --- Landing Page Styles --- */
.landing-hero {
    background-color: var(--primary-blue);
    color: white;
    padding: 80px 40px;
    text-align: center;
    border-radius: 12px;
    margin-bottom: 40px;
    background-image: linear-gradient(rgba(44, 62, 80, 0.85), rgba(44, 62, 80, 0.85)), url('https://www.transparenttextures.com/patterns/cubes.png');
}

.landing-hero h1 {
    color: white;
    font-size: 3rem;
    margin: 0;
}

.landing-hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 15px auto 0 auto;
}

.feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* CORRECTED: This is the final, robust fix for the card alignment */
.feature-card {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px auto;
    background-color: var(--accent-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; 
}

.feature-icon svg {
    width: 30px;
    height: 30px;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin: 0 0 15px 0;
}

.feature-card p {
    color: #7f8c8d;
    line-height: 1.6;
    margin-bottom: 30px;
    flex-grow: 1; 
}

.feature-card .btn {
    width: 100%;
}

/* Special style for the main store button in the nav */
.nav-button-special {
    background-color: var(--accent-color);
    color: white !important;
    font-weight: 700 !important;
    transition: all 0.3s ease !important;
}

.nav-button-special:hover {
    background-color: #2980b9 !important;
    transform: translateY(-2px);
}

/* --- Privacy Notice on Upload Page --- */
.privacy-notice {
    width: 100%;
    max-width: 600px;
    margin-top: -20px; /* Pull it up closer to the button */
    padding: 15px 20px;
    background-color: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.privacy-notice .privacy-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: var(--secondary-blue);
}

/* --- NEW: Impersonation Banner --- */
.impersonation-banner {
    background-color: #f39c12;
    color: white;
    text-align: center;
    padding: 10px;
    font-weight: bold;
}
.impersonation-banner a {
    color: white;
    text-decoration: underline;
}
