/**
 * CardMaker Fast Print Page Styles
 */

/* ========================================
   Variables
   ======================================== */
:root {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --radius: 8px;
}

/* ========================================
   Reset & Base
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-100);
    color: var(--gray-900);
    line-height: 1.5;
}

/* ========================================
   Layout
   ======================================== */
.print-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.print-header {
    background: white;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--gray-200);
}

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

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

.print-main {
    flex: 1;
    display: flex;
    gap: 2rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.print-panel {
    flex: 1;
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.print-panel h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

.preview-panel {
    flex: 1;
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.preview-panel h3 {
    margin-bottom: 1rem;
}

/* ========================================
   Drop Zone
   ======================================== */
.drop-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.drop-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.drop-text {
    font-size: 1.125rem;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.drop-subtext {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* ========================================
   File Info
   ======================================== */
.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.file-icon {
    font-size: 2rem;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 600;
}

.file-meta {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* ========================================
   Print Options
   ======================================== */
.print-options {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.print-options h3 {
    margin-bottom: 1rem;
}

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

.option-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: white;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.print-actions {
    margin-top: 1.5rem;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

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

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

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-50);
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    width: 100%;
}

/* ========================================
   Preview
   ======================================== */
.preview-wrapper {
    background: var(--gray-100);
    border-radius: var(--radius);
    padding: 1rem;
    overflow: auto;
    max-height: 600px;
}

.preview-page {
    background: white;
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    padding: 10mm;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 5mm;
    justify-content: center;
    align-content: flex-start;
}

.preview-card {
    width: 85.6mm;
    height: 54mm;
    border: 1px dashed var(--gray-300);
    background: white;
    position: relative;
    overflow: hidden;
}

.preview-card.no-cut-lines {
    border: none;
}

/* ========================================
   Affiliates
   ======================================== */
.print-affiliates {
    background: white;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--gray-200);
}

.print-affiliates h3 {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
    text-align: center;
}

.affiliate-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.affiliate-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--gray-700);
    transition: all 0.15s ease;
}

.affiliate-link:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.affiliate-logo {
    font-size: 1.25rem;
}

.affiliate-name {
    font-weight: 500;
}

/* ========================================
   Print Sheet (actual print output)
   ======================================== */
.print-sheet {
    display: none;
}

@media print {
    body * {
        visibility: hidden;
    }
    
    .print-sheet,
    .print-sheet * {
        visibility: visible;
    }
    
    .print-sheet {
        display: block;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    
    .print-page {
        page-break-after: always;
        width: 210mm;
        height: 297mm;
        padding: 10mm;
        display: flex;
        flex-wrap: wrap;
        gap: 5mm;
        justify-content: center;
        align-content: flex-start;
    }
    
    .print-card {
        width: 85.6mm;
        height: 54mm;
        border: 1px dashed #ccc;
        overflow: hidden;
    }
    
    .print-card.no-cut-lines {
        border: none;
    }
}

/* ========================================
   Utilities
   ======================================== */
.hidden {
    display: none !important;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 900px) {
    .print-main {
        flex-direction: column;
    }
    
    .preview-page {
        width: 100%;
        min-height: auto;
        transform: scale(0.6);
        transform-origin: top center;
    }
}

@media (max-width: 600px) {
    .print-header {
        padding: 1rem;
    }
    
    .print-main {
        padding: 1rem;
    }
    
    .print-panel {
        padding: 1.5rem;
    }
}
