/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&family=Playfair+Display:ital,wght@0,400;0,700;1,400&display=swap');

:root {
    /* Colors */
    --primary-color: #0f172a;
    /* Deep Ocean Blue */
    --secondary-color: #1e293b;
    /* Darker Blue */
    --accent-color: #fbbf24;
    /* Amber Gold */
    --action-blue: #2563eb;
    /* Vibrant Professional Blue */
    --text-light: #f8fafc;
    --text-dark: #334155;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --card-bg: rgba(255, 255, 255, 0.95);

    /* Spacing */
    --container-padding: 2rem;
    --border-radius: 16px;

    /* Transitions */
    --transition-speed: 0.3s;
}

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

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-dark);
    background-color: #f1f5f9;
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Playfair Display', serif;
    color: var(--primary-color);
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* Professional Top Bar */
.top-bar {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1600px;
    margin: 0 auto;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mini-logo {
    height: 32px;
    width: auto;
    border-radius: 4px;
}

.panel-tag {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    border-left: 2px solid #e2e8f0;
    padding-left: 1rem;
    margin-left: 0.5rem;
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 300px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.sidebar-header h3 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin: 0;
}

.saved-quotes-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.quote-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quote-item:hover {
    border-color: var(--accent-color);
    background: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.quote-item h4 {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    color: var(--primary-color);
}

.quote-item p {
    font-size: 0.8rem;
    color: #64748b;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid #f1f5f9;
}

.empty-msg {
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
    margin-top: 2rem;
}

/* Productivity Layout Tweaks */
.main-content {
    flex: 1;
    background: #f8fafc;
    width: 0;
    /* Important for flex-child overflow */
}

.quoting-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

.quoting-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    /* Reduced gap */
    align-items: start;
}

.quote-form-container {
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.form-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.form-title::after {
    width: 30px;
}

/* Quoting Layout */
.quoting-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.form-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    position: relative;
}

.form-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--accent-color);
    margin-top: 0.5rem;
    border-radius: 2px;
}

.quote-form-container {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.quote-preview-container {
    position: sticky;
    top: 120px;
}

.form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.half-width {
    flex: 1;
}

.form-divider {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 2rem 0;
}

.quote-form-container h3 {
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

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

.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    display: flex;
    flex-direction: column;
}

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

.card-image-container {
    height: 200px;
    overflow: hidden;
}

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

.card:hover .card-image-container img {
    transform: scale(1.05);
}

.card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #64748b;
}

.card-price {
    font-size: 1.25rem;
    color: var(--accent-color);
    font-weight: 700;
    margin-top: auto;
}

.card-details {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.9rem;
}

.card-details ul {
    list-style-type: disc;
    padding-left: 1.2rem;
    margin-bottom: 0.5rem;
}

/* Contact / Agency Info */
.agency-footer {
    background: var(--primary-color);
    color: var(--text-light);
    padding: 4rem 0;
    text-align: center;
}

.contact-info {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color var(--transition-speed);
}

.form-group textarea {
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
}

/* Responsiveness */
@media (max-width: 992px) {
    .quoting-grid {
        grid-template-columns: 1fr;
    }

    .quote-preview-container {
        position: static;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* Print Friendly - Native Fallback */
@media print {

    /* Hide EVERYTHING by default is too aggressive with the new nesting, 
       we will hide specific large containers instead. */

    /* Unhide the preview container but treat it as the main page */
    body {
        display: block !important;
        background: white !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* Specifically unhide the parent containers needed to show the preview area */
    .main-content,
    .quoting-section,
    .quoting-grid,
    .quote-preview-container {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        visibility: visible !important;
    }

    .quote-form-container,
    .sidebar,
    .top-bar,
    .hero,
    header,
    .agency-footer {
        display: none !important;
    }

    /* Target the specific content to print */
    .pdf-preview-area {
        display: block !important;
        visibility: visible !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }

    /* Ensure text is black for printing */
    .pdf-preview-area * {
        color: black !important;
        visibility: visible !important;
    }

    /* Allow images to span full width if needed */
    .pdf-preview-area img {
        max-width: 100% !important;
        height: auto !important;
    }
}

/* PDF Preview Area (This is what gets printed / displayed on right) */
.pdf-preview-area {
    background: white;
    padding: 40px;
    /* Generous padding for PDF look */
    border: 1px solid #ddd;
    margin-bottom: 30px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
    max-width: 800px;
    /* Letter/A4ish ratio width */
    margin-left: auto;
    margin-right: auto;
}

.pdf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
}

.pdf-agency-info {
    text-align: right;
}

.pdf-agency-info h3 {
    margin: 0 0 5px 0;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.pdf-agency-info p {
    margin: 0;
    font-size: 0.9em;
    color: #64748b;
}

.pdf-body {
    margin-top: 15px;
    line-height: 1.2;
    font-size: 11pt;
}

.includes-section {
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: 8px;
    margin: 8px 0;
    border-left: 4px solid var(--accent-color);
}

.pdf-body ul {
    list-style-type: none;
    padding: 0;
    margin: 5px 0 0 0;
}

.pdf-body ul li {
    padding: 0;
    border-bottom: none;
    display: flex;
    align-items: flex-start;
    /* Align to top */
    font-size: 10pt;
    line-height: 1.1;
    margin-bottom: 2px;
    /* Tiny gap between items */
}

.pdf-body ul li:before {
    content: "✓";
    color: var(--accent-color);
    font-weight: bold;
    margin-right: 10px;
}

.price-tag {
    font-size: 2rem;
    color: var(--primary-color);
    margin-top: 20px;
    text-align: right;
    background: #f1f5f9;
    padding: 10px 20px;
    border-radius: 8px;
    float: right;
    clear: both;
}

.pdf-footer {
    margin-top: 20px;
    text-align: left;
    font-size: 9pt;
    /* Explicitly 9pt for conditions */
    color: #64748b;
    border-top: 1px solid #eee;
    padding-top: 10px;
    clear: both;
    line-height: 1.1;
}

/* Actions */
.form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

#btn-share-whatsapp {
    grid-column: span 2;
}

.btn-primary,
.btn-whatsapp,
.btn-email,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
    width: 100%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
}

.btn-whatsapp {
    background-color: #25D366;
    color: white;
    text-decoration: none;
}

.btn-email {
    background-color: #EA4335;
    color: white;
    text-decoration: none;
}

.btn-primary:hover,
.btn-whatsapp:hover,
.btn-email:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    opacity: 0.95;
}

/* Login Modal Specific Styles */
.login-modal-content {
    max-width: 400px;
    text-align: center;
    padding: 2.5rem;
}

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

.login-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.login-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.error-message {
    background: #fff5f5;
    color: #e53e3e;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    border: 1px solid #feb2b2;
}

.btn-block {
    width: 100%;
    justify-content: center;
    padding: 1rem;
    font-size: 1rem;
    margin-top: 1rem;
}

#auth-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-secondary {
    background: white;
    border: 1px solid #cbd5e1;
    color: var(--text-dark);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-blue {
    background: var(--action-blue);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
}

.btn-blue:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

@media (max-width: 768px) {
    #auth-buttons {
        margin-bottom: 1rem;
        flex-direction: column;
        width: 100%;
    }

    .btn-secondary {
        justify-content: center;
    }
}