/**
 * WooCart Print Service - Styles
 * Compatible with most WordPress themes including Storefront
 */

/* Container */
.print-service-page {
    direction: rtl;
    text-align: right;
    padding: 40px 0;
    background: #f8f9fa;
    min-height: 60vh;
}

.print-service-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Page Header */
.print-page-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
}

.print-page-header .header-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.print-page-header h1 {
    font-size: 36px;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 10px;
}

.print-page-header .header-subtitle {
    font-size: 18px;
    color: #666;
    margin: 0;
}

/* Form */
.print-form {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Sections */
.print-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.print-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
    color: #1e3a5f;
    margin-bottom: 20px;
}

.section-number {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.section-icon {
    color: #2563eb;
}

/* Option Grid */
.option-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.option-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Option Cards */
.option-card {
    cursor: pointer;
}

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

.option-card .option-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px 20px;
    background: #f8f9fa;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 120px;
}

.option-card:hover .option-content {
    border-color: #2563eb;
    background: #eff6ff;
}

.option-card input:checked + .option-content {
    border-color: #2563eb;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(30, 64, 175, 0.12) 100%);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
}

.option-icon {
    font-size: 28px;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 8px;
}

.option-icon.orientation-icon {
    font-size: inherit;
}

.option-icon.orientation-icon svg {
    color: #64748b;
}

.option-card input:checked + .option-content .option-icon.orientation-icon svg {
    color: #2563eb;
}

.option-count {
    font-size: 32px;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 5px;
}

.option-label {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.option-fee {
    font-size: 12px;
    color: #059669;
    margin-top: 5px;
    font-weight: 600;
}

/* Color Options */
.option-icon.color-black svg circle:first-child {
    fill: #1e293b;
}

.option-icon.color-colorful svg circle:first-child {
    fill: url(#colorGradPrint);
}

/* Form Group */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

.form-group input[type="number"],
.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input[type="number"]:focus,
.form-group input[type="text"]:focus,
.form-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-hint {
    font-size: 13px;
    color: #64748b;
    margin-top: 8px;
}

/* File Upload */
.file-upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: #f8fafc;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.file-upload-area:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.file-upload-area.drag-over {
    border-color: #2563eb;
    background: #dbeafe;
}

.file-upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    color: #94a3b8;
    margin-bottom: 15px;
}

.upload-text {
    font-size: 16px;
    color: #334155;
    margin-bottom: 5px;
}

.upload-hint {
    font-size: 13px;
    color: #94a3b8;
}

.file-name-display {
    margin-top: 15px;
    padding: 12px 16px;
    background: #d1fae5;
    border-radius: 8px;
    color: #059669;
    font-weight: 600;
    display: none;
}

.file-name-display svg {
    vertical-align: middle;
    margin-left: 5px;
}

/* Price Summary */
.price-summary {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    border-radius: 16px;
    padding: 30px;
    margin-top: 30px;
    color: white;
    transition: all 0.3s ease;
}

.price-summary.updated {
    transform: scale(1.02);
}

.summary-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: white;
}

.summary-breakdown {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item .item-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.summary-item .item-value {
    font-weight: 700;
    font-size: 15px;
}

.summary-extras {
    background: rgba(255, 255, 255, 0.05);
    margin: 5px -20px;
    padding: 12px 20px;
    border-radius: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.summary-total {
    background: rgba(255, 255, 255, 0.15);
    margin: 10px -20px -20px;
    padding: 20px;
    border-radius: 0 0 12px 12px;
}

.summary-total .item-label {
    font-size: 16px;
    color: white;
}

.summary-total .item-value {
    font-size: 28px;
    font-weight: 700;
    color: #fbbf24;
}

/* Submit Button */
.form-actions {
    margin-top: 25px;
}

.btn-add-cart {
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.btn-add-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.4);
}

.btn-add-cart:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-add-cart.loading {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.btn-add-cart svg {
    flex-shrink: 0;
}

/* Price Table */
.price-table-section {
    margin-top: 40px;
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.price-table-section h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 20px;
}

.price-table {
    width: 100%;
    border-collapse: collapse;
}

.price-table th,
.price-table td {
    padding: 14px 16px;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.price-table th {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    color: white;
    font-weight: 600;
}

.price-table tr:nth-child(even) {
    background: #f8fafc;
}

.price-table td strong {
    color: #059669;
}

/* Features Section */
.features-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.feature-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.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 15px;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.feature-card h4 {
    font-size: 16px;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

/* Modal */
.print-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-icon.success {
    background: #d1fae5;
    color: #059669;
}

.modal-content h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 15px;
}

.modal-summary {
    font-size: 16px;
    color: #64748b;
    margin-bottom: 25px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-modal {
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-modal.btn-cart {
    background: #f1f5f9;
    color: #334155;
}

.btn-modal.btn-cart:hover {
    background: #e2e8f0;
}

.btn-modal.btn-checkout {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
}

.btn-modal.btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(5, 150, 105, 0.4);
}

.modal-close {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #e2e8f0;
    color: #334155;
}

/* Responsive */
@media (max-width: 768px) {
    .print-service-page {
        padding: 20px 0;
    }

    .print-page-header h1 {
        font-size: 28px;
    }

    .print-page-header .header-subtitle {
        font-size: 16px;
    }

    .print-form {
        padding: 20px;
    }

    .option-grid {
        grid-template-columns: 1fr;
    }

    .option-grid.cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-title {
        font-size: 16px;
    }

    .features-section {
        grid-template-columns: 1fr;
    }

    .price-summary {
        padding: 20px;
    }

    .summary-total .item-value {
        font-size: 24px;
    }

    .modal-actions {
        flex-direction: column;
    }

    .btn-modal {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .option-grid.cols-3 {
        grid-template-columns: 1fr;
    }

    .price-table th,
    .price-table td {
        padding: 10px 8px;
        font-size: 13px;
    }
}

/* Theme Compatibility - Storefront */
.woocommerce-page .print-service-page {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.woocommerce-page .print-service-page h1,
.woocommerce-page .print-service-page h2,
.woocommerce-page .print-service-page h3,
.woocommerce-page .print-service-page h4 {
    font-family: inherit;
}

/* Spinner Animation */
.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Accessibility */
.option-card:focus-within .option-content {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.btn-add-cart:focus {
    outline: 2px solid #059669;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .print-service-page {
        background: white;
        padding: 20px;
    }

    .form-actions,
    .btn-add-cart,
    .features-section {
        display: none;
    }
}
