@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #64748b;
    --background: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --success: #10b981;
    --error: #ef4444;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    background: #f1f5f9;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
}

/* Hero */
.hero {
    text-align: center;
    margin-bottom: 2.5rem;
}

.hero h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.hero p {
    color: var(--text-muted);
    font-size: 1.125rem;
}

/* Upload Card */
.upload-card {
    background: var(--surface);
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 2rem;
    margin-bottom: 2rem;
}

.grid-cols-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .grid-cols-2 {
        grid-template-columns: 1fr 1fr;
    }
}

.upload-box {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.upload-box.full-width {
    grid-column: 1 / -1;
}

.upload-label {
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.step-badge {
    background: var(--primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.2s;
    background: #f8fafc;
    cursor: pointer;
}

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

/* Fix for drag flickering and smooth clicks */
.drop-zone * {
    pointer-events: none;
}

.drop-zone i {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.drop-text {
    font-weight: 500;
    color: var(--text-main);
}

.drop-subtext {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.file-info {
    display: none;
    align-items: center;
    gap: 0.5rem;
    background: #f0fdf4;
    color: #166534;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    border: 1px solid #bbf7d0;
}

.error-msg {
    display: none;
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Layout Grid */
.layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

/* Floating WhatsApp Button */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    right: 40px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 3px #999;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    background-color: #128C7E;
    transform: scale(1.1);
}

.whatsapp-float i {
    margin-top: 0px; /* Adjust if needed */
}

.layout-card {
    position: relative;
    border: 2px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    display: block;
}

.layout-card:hover {
    border-color: #93c5fd;
    background: #f8fafc;
}

.layout-card input[type="radio"] {
    position: absolute;
    top: 1rem;
    right: 1rem;
    accent-color: var(--primary);
    width: 1.25rem;
    height: 1.25rem;
}

.layout-card:has(input:checked) {
    border-color: var(--primary);
    background: #eff6ff;
    box-shadow: 0 0 0 1px var(--primary);
}

.card-content {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.icon-box {
    width: 40px;
    height: 40px;
    background: #e0f2fe;
    color: var(--primary);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.text-box h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.text-box p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Visual Preview CSS Art */
.visual-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    border: 1px dashed #cbd5e1;
    margin-top: 1rem;
    min-height: 80px;
}
.vp-page {
    background: white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: #64748b;
    font-weight: bold;
}
.a4 { width: 30px; height: 42px; border: 1px solid #cbd5e1; }
.a4-half { width: 30px; height: 42px; border: 1px solid #cbd5e1; }
.thermal { width: 30px; height: 45px; border: 1px solid #cbd5e1; border-radius: 2px; }
.a4-mini { width: 15px; height: 21px; border: 1px solid #cbd5e1; font-size: 6px; }
.a4-micro { width: 12px; height: 16px; border: 1px solid #cbd5e1; font-size: 5px; }

/* 4x6 Crop Preview */
.vp-label { background: #dbeafe; width: 100%; height: 55%; border-bottom: 1px dashed #93c5fd; display: flex; align-items: center; justify-content: center; }
.vp-waste { background: #fee2e2; width: 100%; height: 45%; display: flex; align-items: center; justify-content: center; color: #ef4444; font-size: 6px; }

/* 2-in-1 Preview */
.vp-group { display: flex; flex-direction: column; gap: 4px; }
.vp-split-top { background: #dbeafe; flex: 1; border-bottom: 1px dashed #93c5fd; width: 100%; display: flex; align-items: center; justify-content: center; font-size: 6px; }
.vp-split-bottom { background: #dbeafe; flex: 1; width: 100%; display: flex; align-items: center; justify-content: center; font-size: 6px; }

/* 4-in-1 Preview */
.vp-group-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.vp-quad-grid { width: 100%; height: 100%; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.vp-quad { background: #dbeafe; border: 0.5px dashed #93c5fd; display: flex; align-items: center; justify-content: center; font-size: 5px; }

/* Live Preview Box */
.preview-box {
    margin-top: 1rem;
    background: #f1f5f9;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.preview-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
}
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
}
.nav-btn {
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 2px 6px;
    cursor: pointer;
    color: #475569;
}
.nav-btn:hover {
    background: #e2e8f0;
}
.canvas-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: white;
    border: 1px solid #cbd5e1;
    display: flex;
    justify-content: center;
    min-height: 100px;
    /* Checkerboard pattern for transparency */
    background-image: linear-gradient(45deg, #f0f0f0 25%, transparent 25%), 
                      linear-gradient(-45deg, #f0f0f0 25%, transparent 25%), 
                      linear-gradient(45deg, transparent 75%, #f0f0f0 75%), 
                      linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}
#pdf-preview {
    max-width: 100%;
    height: auto;
    display: block;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}
.preview-note {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 0.5rem;
    text-align: center;
}


/* Action Section */
.action-section {
    text-align: center;
    margin-top: 2rem;
}

.btn-convert {
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem 3rem;
    border-radius: 99px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-convert:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px -1px rgba(37, 99, 235, 0.4);
}

.btn-login {
    background: white;
    color: var(--primary);
    border: 1px solid var(--border);
    padding: 0.5rem 1.25rem;
    border-radius: 99px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-convert:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    opacity: 0.7;
}

/* Result Section */
.result-section {
    display: none;
    margin-top: 2rem;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.loader-container {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 1rem;
    border: 1px solid var(--border);
}

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

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

.success-card {
    display: none;
    text-align: center;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 1rem;
    padding: 3rem;
}

.success-icon {
    width: 64px;
    height: 64px;
    background: #dcfce7;
    color: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1.5rem;
}

.btn-download {
    display: inline-block;
    background: var(--success);
    color: white;
    text-decoration: none;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    margin-top: 1.5rem;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
}

.btn-download:hover {
    background: #059669;
    transform: translateY(-2px);
}

/* Tools Grid (New) */
.tools-section {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

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

.tool-category h3 {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary); /* Blue headings like screenshot */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.tool-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tool-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.tool-link:hover {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    color: var(--primary);
}

.tool-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: white; /* Default bg */
    color: white;
    font-size: 0.9rem;
}

/* Specific Icon Colors to match screenshot loosely */
.icon-pink { background: #ec4899; }
.icon-blue { background: #3b82f6; }
.icon-yellow { background: #eab308; }
.icon-dark { background: #1e293b; }
.icon-green { background: #10b981; }
.icon-red { background: #ef4444; }

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
    color: var(--text-muted);
}

.trust-badges {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.badge {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Platform Selection */
.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.platform-card {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    text-align: center;
    background: white;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.platform-card:hover {
    border-color: #93c5fd;
    background: #f8fafc;
}

.platform-card input[type="radio"] {
    position: absolute;
    top: 5px;
    right: 5px;
    margin: 0;
    accent-color: var(--primary);
}

.platform-card:has(input:checked) {
    border-color: var(--primary);
    background: #eff6ff;
    box-shadow: 0 0 0 1px var(--primary);
}

.platform-card .p-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.platform-card i {
    font-size: 1.25rem;
    color: var(--text-muted);
}
.platform-card:has(input:checked) i {
    color: var(--primary);
}
