/**
 * Photo Upload Frontend Styles
 * Modern, responsive styling for the photo upload interface
 */

/* ========================================
   DIMENSION VALIDATION ERRORS
   ======================================== */

#dimension-error-width,
#dimension-error-height {
    margin: 2px 0 !important;
    padding: 4px 8px !important;
    background: #ffebee !important;
    color: #c62828 !important;
    border: 1px solid #ffcdd2 !important;
    border-radius: 3px !important;
    font-size: 9px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    display: block !important;
    max-width: 200px !important;
}

/* ========================================
   MAIN CONTAINER
   ======================================== */

.photo-upload-container {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.photo-upload-container h3 {
    color: #333;
    margin: 0 0 10px 0;
    font-size: 1.5em;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.photo-upload-container p {
    color: #666;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

/* ========================================
   SECTION STYLES
   ======================================== */

.photo-upload-section {
    margin: 5px 0;
    padding: 0px 20px 20px;
    background: transparent;
    border-radius: 6px;
    border-bottom: 1px solid gray;
    border-right: 1px solid gray;
    border-left: 1px solid gray;
    box-shadow: 7px 6px 4px 2px rgba(0, 0, 0, 0.1);
    transform: scale(0.9);
    background: linear-gradient(300deg, #0000001c, transparent);
}

.dimensions-section,
.options-section,
.price-calculation-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 6px;
    border-left: 4px solid #0073aa;
}

.photo-upload-section h4,
.dimensions-section h4,
.options-section h4,
.price-calculation-section h4 {
    color: #0073aa;
    margin: 0 0 15px 0;
    font-size: 1.2em;
    font-weight: 600;
}

/* ========================================
   PHOTO UPLOAD AREA
   ======================================== */

.photo-upload-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
    position: relative;
}

.photo-upload-area:hover {
    border-color: #0073aa;
    background: #f0f6fc;
}

.photo-upload-area.drag-over {
    border-color: #0073aa;
    background: #e7f3ff;
    transform: scale(1.02);
}

.upload-placeholder {
    color: #666;
}

.upload-placeholder .dashicons {
    font-size: 48px;
    color: #0073aa;
    margin-bottom: 15px;
}

.upload-placeholder p {
    margin: 10px 0;
    font-size: 16px;
}

.upload-info {
    font-size: 14px !important;
    color: #999 !important;
    margin-top: 15px !important;
}

/* ========================================
   PHOTO PREVIEW
   ======================================== */

.photo-preview {
    text-align: center;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.photo-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
}

.photo-info {
    text-align: left;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
}

.photo-info p {
    margin: 8px 0;
    font-size: 14px;
}

.remove-photo {
    background: #dc3232 !important;
    border-color: #dc3232 !important;
    color: white !important;
    margin-top: 10px;
}

.remove-photo:hover {
    background: #c92626 !important;
    border-color: #c92626 !important;
}

/* ========================================
   INPUT STYLES
   ======================================== */

input#user-photo-upload {
    background: #3382ff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px !important;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

input#user-photo-upload:hover {
    background: #2a6bcc;
    transform: translateY(-1px);
}

input#user-photo-upload:active {
    transform: translateY(0);
}

/* Dimension labels on cube-container */
.cube-container {
    position: relative;
}

.dimension-label {
    font-family: Arial, sans-serif;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

input#photo-width {
    background: white;
    -moz-appearance: textfield; /* Firefox */
}

input#photo-width::-webkit-outer-spin-button,
input#photo-width::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input#photo-height {
    background: white;
    -moz-appearance: textfield; /* Firefox */
}

input#photo-height::-webkit-outer-spin-button,
input#photo-height::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ========================================
   DIMENSION INPUTS
   ======================================== */

.dimension-inputs {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: flex-end;
    flex-wrap: nowrap;
}

/* ========================================
   PHOTO DIMENSIONS ROW
   ======================================== */

.photo-dimensions-row {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    margin-bottom: 20px;
    flex-wrap: nowrap;
}

.dimension-input-container {
    flex: 1;
    min-width: 50px;
    max-width: 120px;
}

.dimension-input-container input {
    width: 90%;
    padding: 20px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 25px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

#mockup-progress-bar {
    position: absolute;
    bottom: 15px;
    left: 25%;
    right: 25%;
    height: 11px;
    background: rgb(0, 0, 0) !important;
    z-index: 1000;
    border-radius: 10px !important;
    box-shadow: 1px 1px 1px #ececec;
}

.print-area-container {
    flex: 0 0 40%;
    min-width: 100px;
    flex-wrap: wrap;
    margin-top: -2px;
}

.dimension-input-container label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
    max-width: 90px;
}

.fill-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 600;
    color: #333;
    font-size: 14px;
    flex-direction: column;
    margin-left: 21px;
    margin-bottom: -6px;
}

input#photo-fill:checked {
    transform: scale(1.5);
}

input#passpartout-checkbox:checked {
    transform: scale(1.6);
}

input#lucia-ink-checkbox {
    transform: scale(1.35);
}

input#lucia-ink-checkbox:checked {
    transform: scale(1.6);
}

input#passpartout-checkbox {
    transform: scale(1.35);
}

.checkbox-options label:last-child {
    width: 50%;
    height: 30px;
    background: repeating-linear-gradient(45deg, #5b0505, #00000063 100px);
    color: white;
}

.lucia-ink-description {
    color: white !important;
}

/* ========================================
   ASPECT RATIO LOCK
   ======================================== */

.aspect-ratio-lock-container {
    display: flex;
    align-items: center;
    margin: 0px 12px 5px 0px;
    padding-top: 20px;
}

button#aspect-ratio-lock {
    background-color: black !important;
    padding: 2px 7px 0px 7px !important;
    border-radius: 7px !important;
    display: inline-block !important;
    color: #fff !important;
    fill: #ffffff !important;
    height: 35px !important;
    line-height: 48px !important;
    border: none !important;
    font-weight: 700 !important;
    text-align: center !important;
    transition: all 0.3s !important;
    cursor: pointer !important;
    outline: none !important;
    width: 41px !important;
}

button#aspect-ratio-lock:hover {
    background-color: #333 !important;
    transform: scale(1.05) !important;
}

button#aspect-ratio-lock:active {
    transform: scale(0.95) !important;
}

button#aspect-ratio-lock.locked {
    background-color: #000000 !important;
    color: #fff !important;
}

button#aspect-ratio-lock.locked:hover {
    background-color: #333 !important;
}

button#aspect-ratio-lock.unlocked {
    background-color: #28a745 !important;
    color: #fff !important;
}

button#aspect-ratio-lock.unlocked:hover {
    background-color: #1e7e34 !important;
}

.lock-icon {
    font-size: 30px;
    line-height: 1;
    display: inline-block;
    vertical-align: top;
}

.dimension-inputs > div {
    flex: 1;
    min-width: 0;
}

.dimension-input {
    display: flex;
    flex-direction: column;
}

.dimension-input label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.dimension-input input {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.dimension-input input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.dimension-limit {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

.dimension-calculations {
    background: #e7f3ff;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #0073aa;
}

.dimension-calculations p {
    margin: 5px 0;
    font-weight: 500;
}

/* ========================================
   OPTION SELECTIONS
   ======================================== */

.option-group {
    margin-bottom: 20px;
}

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

.option-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    background: white;
    transition: border-color 0.3s ease;
}

.option-group select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.additional-options {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.option-checkbox {
    margin-bottom: 15px;
}

.option-checkbox label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #333;
}

.option-checkbox input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

/* ========================================
   PRICE CALCULATION
   ======================================== */

.price-calculation-section {
    background: #f0f6fc !important;
    border-left-color: #46b450 !important;
}

#calculate-photo-price {
    background: #0073aa !important;
    border-color: #0073aa !important;
    color: white !important;
    padding: 12px 24px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    transition: all 0.3s ease !important;
}

#calculate-photo-price:hover {
    background: #005a87 !important;
    border-color: #005a87 !important;
    transform: translateY(-1px);
}

#calculate-photo-price:disabled {
    background: #ccc !important;
    border-color: #ccc !important;
    cursor: not-allowed;
    transform: none;
}

.price-display {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.total-price {
    text-align: center;
    margin-bottom: 20px;
}

.total-price h3 {
    color: #46b450;
    font-size: 1.8em;
    margin: 0;
    border: none;
    padding: 0;
}

.price-breakdown {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 6px;
}

.price-breakdown h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.1em;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

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

.breakdown-label {
    font-weight: 600;
    color: #333;
    flex: 1;
}

.breakdown-cost {
    font-weight: 600;
    color: #46b450;
    margin: 0 20px;
}

.breakdown-desc {
    color: #666;
    font-size: 14px;
    flex: 2;
    text-align: right;
}

#add-photo-to-cart {
    background: #46b450 !important;
    border-color: #46b450 !important;
    color: white !important;
    padding: 15px 30px !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    transition: all 0.3s ease !important;
    width: 100%;
}

#add-photo-to-cart:hover {
    background: #3d8a46 !important;
    border-color: #3d8a46 !important;
    transform: translateY(-1px);
}

#add-photo-to-cart:disabled {
    background: #ccc !important;
    border-color: #ccc !important;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   NOTICES AND MESSAGES
   ======================================== */

.photo-upload-container .notice {
    border-radius: 6px;
    border-left-width: 4px;
    padding: 15px;
    margin: 15px 0;
}

.photo-upload-container .notice-success {
    background: #f0f6fc;
    border-left-color: #46b450;
}

.photo-upload-container .notice-error {
    background: #fef7f1;
    border-left-color: #dc3232;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .photo-upload-container {
        padding: 20px;
        margin: 15px 0;
    }
    
    .dimension-inputs {
        flex-direction: column;
        gap: 15px;
    }
    
    .dimension-inputs > div {
        flex: none;
        min-width: auto;
    }
    
    .aspect-ratio-lock-container {
        margin: 10px 0;
        padding-top: 0;
    }
    
    button#aspect-ratio-lock {
        width: 35px !important;
        height: 30px !important;
        line-height: 30px !important;
        padding: 2px 5px 0px 5px !important;
    }
    
    .lock-icon {
        font-size: 26px !important;
    }
    
    .photo-dimensions-row {
        display: flex;
        flex-direction: row !important;
        align-items: center;
        gap: 0px !important;
        flex-wrap: nowrap;
    }
    
    .aspect-ratio-lock-container {
        margin-bottom: -10px;
    }
    
    .dimension-input-container {
        width: 100%;
        max-width: 114px;
    }
    
    .photo-upload-section, .dimensions-section, .options-section, .price-calculation-section {
        transform: scale(1);
    }
    
    .upload-print-row {
        flex-direction: row!important;
        gap: 10px !important;
    }

    .upload-file-container, .print-area-container {
        flex: 0 0 50% !important;
        min-width: auto !important;
    }
    
    .photo-upload-section,
    .dimensions-section,
    .options-section,
    .price-calculation-section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .photo-upload-area {
        padding: 30px 15px;
    }
    
    .upload-placeholder .dashicons {
        font-size: 36px;
    }
    
    .upload-placeholder p {
        font-size: 14px;
    }
    
    .photo-preview img {
        max-width: 150px;
        max-height: 150px;
    }
    
    .breakdown-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .breakdown-cost {
        margin: 0;
    }
    
    .breakdown-desc {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .photo-upload-container {
        padding: 15px;
    }
    
    .photo-upload-container h3 {
        font-size: 1.3em;
    }
    
    .photo-upload-section h4,
    .dimensions-section h4,
    .options-section h4,
    .price-calculation-section h4 {
        font-size: 1.1em;
    }
    
    .photo-upload-area {
        padding: 20px 10px;
    }
    
    .upload-placeholder .dashicons {
        font-size: 32px;
    }
    
    .upload-placeholder p {
        font-size: 13px;
    }
    
    .upload-info {
        font-size: 12px !important;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */

.photo-upload-container {
    animation: fadeInUp 0.5s ease-out;
}

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

.photo-upload-area,
.photo-preview,
.dimension-calculations,
.price-display {
    transition: all 0.3s ease;
}

.option-group select,
.dimension-input input {
    transition: all 0.3s ease;
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.photo-upload-area:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.option-group select:focus,
.dimension-input input:focus {
    outline: none;
}

.option-checkbox input[type="checkbox"]:focus + label {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .photo-upload-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .photo-upload-area,
    .photo-preview {
        border: 1px solid #000;
    }
    
    #calculate-photo-price,
    #add-photo-to-cart {
        display: none;
    }
}



