/* Wax Paper Designer Styles */

.wax-paper-designer-container {
    padding: 2rem 0;
}

/* Progress Steps Styles */
.progress-steps {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 10px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 1rem;
    position: relative;
    opacity: 0.5;
}

.step.clickable {
    cursor: pointer;
}

.step.clickable:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

.step.active {
    opacity: 1;
}

.step.completed {
    opacity: 1;
    color: #28a745;
    cursor: pointer;
}

.step.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.step.completed .step-number {
    background: #28a745;
    color: white;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.step.active .step-number {
    background: #e4aa3f;
    color: white;
}

.step-title {
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
}

/* Upload Area Styles */
.upload-area {
    cursor: pointer;
    border: 2px dashed #e4aa3f !important;
    background: linear-gradient(145deg, #f8f9fa 0%, #ffffff 100%);
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #d69e36 !important;
    background: linear-gradient(145deg, #fff9f0 0%, #f8f9fa 100%);
    box-shadow: 0 8px 25px rgba(228, 170, 63, 0.2);
}

.upload-area.dragover {
    border-color: #28a745 !important;
    background: linear-gradient(145deg, #e8f5e8 0%, #f8f9fa 100%);
}

.upload-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    color: #495057;
}

.upload-spinner-small {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.upload-spinner .spinner-border,
.upload-spinner-small .spinner-border {
    color: #e4aa3f !important;
}

/* Template Card Styles */
.template-card {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: white;
    transition: all 0.3s ease;
}

.template-card:hover {
    border-color: #e4aa3f;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.template-card.selected {
    border-color: #e4aa3f;
    background: #fff9f0;
    box-shadow: 0 8px 20px rgba(228, 170, 63, 0.2);
}

.template-card.small {
    border-radius: 6px;
    margin-bottom: 0.5rem;
    max-width: 100%;
}

.template-card.small:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.template-card.small.selected {
    box-shadow: 0 3px 10px rgba(228, 170, 63, 0.3);
}

.template-card.small .template-info {
    padding: 0.3rem;
    text-align: center;
}

.template-card.small .template-info small {
    font-weight: 500;
    color: #333;
    font-size: 0.75rem;
}

.template-card.small .template-image {
    height: 60px;
    overflow: hidden;
}

.template-card.small .template-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.template-image {
    position: relative;
    overflow: hidden;
}

.template-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(228, 170, 63, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.template-card.selected .template-overlay {
    opacity: 1;
}

.template-overlay i {
    color: white;
    font-size: 2rem;
}

.template-info {
    padding: 1rem;
    text-align: center;
}

.template-info h6 {
    margin-bottom: 0.5rem;
    color: #333;
}

.template-info p {
    margin: 0;
    color: #666;
    font-size: 0.875rem;
}

/* Design Preview Styles */
.preview-section {
    background: white;
    border-radius: 10px;
    padding: 0.75rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.dimensions-display {
    position: relative;
    margin-bottom: 0.5rem;
}

.dimension-label {
    position: absolute;
    background: #e4aa3f;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    z-index: 10;
}

.height-box {
    top: 10px;
    left: -60px;
    transform: rotate(-90deg);
    transform-origin: center;
}

.width-box {
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.main-paper-box {
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    height: 300px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    transition: all 0.3s ease;
    margin: 0 auto;
    width: 100%;
    overflow: hidden;
    padding: 8px;
    position: relative;
}

/* Dynamic height expansion for different patterns */
.main-paper-box.has-pattern {
    height: 600px;
    transition: height 0.3s ease;
}

.main-paper-box.has-pattern.pattern1 {
    height: 600px;
}

.main-paper-box.has-pattern.pattern2 {
    height: 600px;
}

.main-paper-box.has-pattern.pattern3 {
    height: 600px;
}

.main-paper-box.has-pattern.pattern4 {
    height: 600px;
}

.main-paper-box.has-pattern.pattern5 {
    height: 600px;
}

.main-paper-box.has-pattern.pattern6 {
    height: 600px;
}

.main-paper-box.has-pattern.pattern7 {
    height: 600px;
}

.main-paper-box.has-pattern.pattern8 {
    height: 600px;
}

.main-paper-box.has-pattern.pattern9 {
    height: 600px;
}

.main-paper-box.has-pattern.pattern10 {
    height: 600px;
}

.main-paper-box.has-pattern.pattern11 {
    height: 600px;
}

.main-paper-box.has-pattern.pattern12 {
    height: 600px;
}

/* Logo Builder Area */
.logo-builder-area {
    width: 100%;
    height: 100%;
    position: relative;
}

.styles {
    width: 100%;
    height: 100%;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    align-items: flex-start;
    justify-content: flex-start;
}

.width-box{
    position: static;
}

.form-control{
    margin-bottom: 0px !important;
}

.pattern5 .logo-box:nth-child(2n){
    opacity: 1 !important;
}

.logo-box {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
}

.logo-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Template Pattern Styles - Exact match with original */
.main-paper-box .styles.pattern1 .logo-box {
    width: calc(100% / 8) !important;
    padding: 10px;
    justify-content: center;
}

.main-paper-box .styles.pattern1 .logo-box img {
    max-width: 65px;
    min-width: 51px;
}

.pattern1-height {
    height: 400px !important;
}

.main-paper-box .styles.pattern2 .logo-box {
    width: calc(100% / 5) !important;
    padding: 7px;
    display: flex;
    justify-content: center;
}

.main-paper-box .styles.pattern3 .logo-box {
    width: calc(100% / 13) !important;
    padding: 7px;
    display: flex;
    justify-content: center;
}

.main-paper-box .styles.pattern3 .logo-box:nth-child(2n) {
    opacity: 0;
    padding: 0px !important;
}

.main-paper-box .styles.pattern4 .logo-box {
    width: calc(100% / 9) !important;
    padding: 7px;
    display: flex;
    justify-content: center;
}

.main-paper-box .styles.pattern4 .logo-box:nth-child(2n) {
    opacity: 0;
}

.main-paper-box .styles.pattern5 .logo-box {
    width: calc(100% / 8) !important;
    padding: 5px;
    display: flex;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
}

.main-paper-box .styles.pattern5 .logo-box:nth-child(3n) {
    opacity: 0.3;
}

.main-paper-box .styles.pattern5 .logo-box:nth-child(5n) {
    transform: scale(0.8);
}

.main-paper-box .styles.pattern6 .logo-box {
    width: calc(100% / 9) !important;
    padding: 7px;
    display: flex;
    justify-content: center;
    transform: rotate(-50deg);
}

.main-paper-box .styles.pattern6 .logo-box:nth-child(2n) {
    opacity: 0;
}

.main-paper-box .styles.pattern7 .logo-box {
    width: calc(100% / 13) !important;
    padding: 2px;
    display: flex;
    justify-content: center;
    transform: rotate(4deg);
}

.main-paper-box .styles.pattern8 .logo-box {
    display: none;
}

.main-paper-box .styles.pattern8 .logo-box:nth-child(1) {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-paper-box .styles.pattern8 .logo-box:nth-child(1) img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Enhanced Pattern Styles */
.main-paper-box .styles.pattern9 .logo-box {
    width: calc(100% / 8) !important;
    padding: 6px;
    display: flex;
    justify-content: center;
    transform: rotate(12deg);
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.main-paper-box .styles.pattern9 .logo-box:nth-child(3n) {
    opacity: 0.8;
    transform: rotate(12deg) scale(0.9);
}

.main-paper-box .styles.pattern9 .logo-box:nth-child(5n) {
    opacity: 0.6;
    transform: rotate(12deg) scale(1.1);
}

.main-paper-box .styles.pattern10 .logo-box {
    width: calc(100% / 7) !important;
    padding: 8px;
    display: flex;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid rgba(228, 170, 63, 0.2);
    background: rgba(255, 255, 255, 0.9);
}

.main-paper-box .styles.pattern10 .logo-box:nth-child(2n) {
    opacity: 0.85;
    transform: scale(0.95);
}

.main-paper-box .styles.pattern10 .logo-box:nth-child(4n) {
    opacity: 0.7;
    transform: scale(1.05);
}

.main-paper-box .styles.pattern11 .logo-box {
    width: calc(100% / 11) !important;
    padding: 4px;
    display: flex;
    justify-content: center;
    transform: rotate(-8deg);
    border-radius: 50%;
    overflow: hidden;
}

.main-paper-box .styles.pattern11 .logo-box:nth-child(3n) {
    opacity: 0.75;
    transform: rotate(-8deg) scale(0.85);
}

.main-paper-box .styles.pattern11 .logo-box:nth-child(5n) {
    opacity: 0.6;
    transform: rotate(-8deg) scale(1.15);
}

.main-paper-box .styles.pattern12 .logo-box {
    width: calc(100% / 9) !important;
    padding: 7px;
    display: flex;
    justify-content: center;
    transform: rotate(6deg);
    border-radius: 8px;
    box-shadow: 0 3px 6px rgba(228, 170, 63, 0.15);
}

.main-paper-box .styles.pattern12 .logo-box:nth-child(2n) {
    opacity: 0.9;
    transform: rotate(6deg) scale(0.9);
}

.main-paper-box .styles.pattern12 .logo-box:nth-child(3n) {
    opacity: 0.7;
    transform: rotate(6deg) scale(1.1);
}

/* Make sure logo images scale properly */
.logo-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.logo-builder-area {
    width: 100%;
    height: 100%;
    position: relative;
}

.styles {
    width: 100%;
    height: 100%;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    align-items: flex-start;
    justify-content: flex-start;
}

.logo-box {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
}

/* Form Section Styles */
.design-section {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: fit-content;
}

.specifications-panel {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: fit-content;
}

.specifications-panel h5 {
    color: #333;
    border-bottom: 2px solid #e4aa3f;
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
}

.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-control-color {
    width: 60px;
    height: 38px;
    border-radius: 6px;
}

.color-preview {
    font-family: monospace;
    font-size: 0.875rem;
    color: #666;
}

/* Order Form Styles */
.order-form-wrapper {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-section {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 1.5rem;
}

.form-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.section-title {
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e4aa3f;
}

.order-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
}

.summary-content p {
    margin-bottom: 0.5rem;
}

.summary-content strong {
    color: #333;
}

/* Button Styles */
.btn-success {
    background-color: #e4aa3f;
    border-color: #e4aa3f;
}

.btn-success:hover {
    background-color: #d69e36;
    border-color: #d69e36;
}

/* Modal Styles */
.countdown-display {
    display: flex;
    justify-content: center;
    align-items: center;
}

.countdown-number {
    font-size: 4rem;
    font-weight: bold;
    color: #e4aa3f;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.progress-bar {
    background: linear-gradient(90deg, #e4aa3f, #d69e36, #e4aa3f);
    background-size: 200% 100%;
}

/* Processing Modal Styles */
.processing-steps {
    text-align: left;
}

.step-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.step-item i {
    margin-right: 0.5rem;
    width: 16px;
}

.step-item.completed {
    color: #28a745;
}

.step-item.active {
    color: #007bff;
    font-weight: bold;
}

/* Thank You Modal Styles */
.success-icon {
    color: #28a745;
}

/* Responsive Design */
@media (max-width: 991px) {
    .main-paper-box {
        height: 250px;
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    
    .wax-paper-designer-container {
        padding: 1rem 0;
    }
    
    .progress-steps {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .step {
        margin: 0.25rem;
        min-width: 80px;
    }
    
    .step-number {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    
    .step-title {
        font-size: 0.7rem;
    }
    
    .template-card {
        margin-bottom: 0.5rem;
    }
    
    .template-card.small .template-info {
        padding: 0.25rem;
    }
    
    .template-card.small .template-info small {
        font-size: 0.7rem;
    }
    
    .template-card.small .template-image {
        height: 50px;
    }
    
    .main-paper-box {
        height: 200px;
        max-width: 100%;
        padding: 6px;
    }
    
    .design-section {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .preview-section {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .logo-controls .btn-sm {
        font-size: 0.7rem;
        padding: 0.4rem 0.6rem;
        margin-bottom: 0.25rem;
    }
    
    .logo-controls h6 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .dimensions-display {
        margin-bottom: 0.5rem;
    }
    
    .dimension-label {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
    
    .upload-area {
        padding: 1.5rem 0.75rem !important;
    }
    
    h3 {
        font-size: 1.4rem;
        margin-bottom: 0.5rem;
    }
    
    h5 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .form-label {
        font-size: 0.9rem;
        font-weight: 600;
    }
    
    .form-control, .form-select {
        padding: 0.6rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 5px;
    }
    
    .wax-paper-designer-container {
        padding: 0.5rem 0;
    }
    
    .main-paper-box {
        height: 180px;
        padding: 4px;
        border-width: 1px;
    }
    
    .progress-steps {
        flex-direction: row;
        justify-content: space-between;
        padding: 0.5rem 0.25rem;
        margin-bottom: 0.75rem;
    }
    
    .step {
        margin: 0.1rem;
        min-width: 60px;
    }
    
    .step-number {
        width: 25px;
        height: 25px;
        font-size: 0.7rem;
    }
    
    .step-title {
        font-size: 0.6rem;
        margin-top: 0.25rem;
    }
    
    .design-section {
        padding: 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    .preview-section {
        padding: 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    .design-section h3, .preview-section h5 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    .design-section p, .preview-section p {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }
    
    .templates-grid .col-4 {
        margin-bottom: 0.5rem;
        padding: 0.125rem;
    }
    
    .template-card.small {
        border-radius: 6px;
    }
    
    .template-card.small .template-info {
        padding: 0.25rem;
    }
    
    .template-card.small .template-info small {
        font-size: 0.65rem;
    }
    
    .logo-controls {
        margin-top: 0.75rem;
    }
    
    .logo-controls h6 {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .logo-controls .row .col-6 {
        margin-bottom: 0.25rem;
        padding: 0.125rem;
    }
    
    .logo-controls .btn-sm {
        font-size: 0.6rem;
        padding: 0.3rem 0.4rem;
        width: 100%;
    }
    
    .quick-actions .btn-sm {
        font-size: 0.6rem;
        padding: 0.3rem 0.4rem;
    }
    
    .dimension-label {
        display: none;
    }
    
    .dimensions-display {
        margin-bottom: 0.25rem;
    }
    
    /* Sidebar Optimizations */
    h5 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .form-label {
        font-size: 0.8rem;
        font-weight: 600;
        margin-bottom: 0.25rem;
    }
    
    .form-control, .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .color-picker-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .form-control-color {
        width: 100%;
        height: 45px;
        border-radius: 6px;
    }
    
    .color-preview {
        font-size: 0.75rem;
    }
    
    small.text-muted {
        font-size: 0.7rem;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        border-radius: 6px;
    }
    
    .btn-lg {
        padding: 0.8rem 1.2rem;
        font-size: 1rem;
    }
    
    /* Upload Area */
    .upload-area {
        padding: 1rem 0.5rem;
        margin-bottom: 1rem;
    }
    
    .upload-area i {
        font-size: 2rem;
    }
    
    .upload-requirements {
        padding: 0.75rem;
    }
    
    .upload-requirements ul {
        font-size: 0.8rem;
    }
}

/* Touch and Mobile Optimizations */
@media (max-width: 768px) {
    /* Better touch targets */
    .template-card {
        min-height: 60px;
        touch-action: manipulation;
    }
    
    .btn, button {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    /* Remove tap highlight on iOS */
    .template-card, .btn {
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Prevent text selection */
    .template-card, .logo-controls .btn {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    /* Better scrolling */
    .step-content {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Mobile navigation buttons */
    .d-flex.flex-column .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn-lg {
        padding: 1rem;
        font-size: 1.1rem;
        font-weight: 600;
    }
    
    /* Enhanced mobile spacing */
    .row.g-2 {
        --bs-gutter-x: 0.5rem;
        --bs-gutter-y: 0.5rem;
    }
    
    .col-4 {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
    
    .col-6 {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
}

@media (max-width: 576px) {
    /* Even better mobile optimization */
    .template-card.small {
        min-height: 55px;
    }
    
    .btn-sm {
        min-height: 40px;
        font-weight: 500;
    }
    
    .main-paper-box {
        border-width: 1px;
    }
    
    /* Improved mobile layout spacing */
    .mb-4 {
        margin-bottom: 1rem !important;
    }
    
    .mt-2 {
        margin-top: 0.5rem !important;
    }
    
    .mt-1 {
        margin-top: 0.25rem !important;
    }
    
    /* Better mobile preview */
    .preview-section {
        border-radius: 8px;
    }
    
    .dimensions-display {
        margin-bottom: 0.5rem;
    }
    
    /* Mobile preview enhancements */
    .preview-section .text-center {
        margin-bottom: 1rem;
    }
    
    .preview-section h5 {
        color: #333;
        font-weight: 600;
    }
    
    .preview-section p {
        color: #666;
    }
    
    /* Better mobile logo controls */
    .logo-controls {
        background: rgba(248, 249, 250, 0.8);
        border-radius: 6px;
        padding: 0.75rem;
        margin-top: 1rem;
    }
    
    .quick-actions {
        background: rgba(248, 249, 250, 0.8);
        border-radius: 6px;
        padding: 0.75rem;
        margin-top: 0.75rem;
    }
}

/* Security: Disable text selection and right-click */
.wax-paper-designer-container * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.wax-paper-designer-container input,
.wax-paper-designer-container select,
.wax-paper-designer-container textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Disable image dragging */
.wax-paper-designer-container img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}
