body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    margin: 0;
    color: #333;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#title {
    text-align: center;
    color: #0077ff;
    font-size: 25px;
    font-weight: 600;
    margin-bottom: 30px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.6s ease-out;
}

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


#controls{
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin-bottom: 40px;
}

/* Responsive layout */
#layout {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}
@media (width: 800px) {
    #layout { 
        flex-direction: column;
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        align-content: center;
     }
     #title{
        font-size: 40px;
        margin-bottom: 30px;
     }
     #controls{
        max-width: 800px;
        display: flex;
        align-items: center;
        justify-content: space-evenly;
        padding: 40px;
        margin-bottom: 40px;
     }
        /* #cropperPanel > div{
        width: 540px !important;
} */

}

/* Cropper Panel */
#cropperPanel {
    display: block;
    align-items: center;
    justify-content: center;
    justify-items: center;
    background: #ffffff;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
#cropperPanel:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

#cropImage {
    width: 100%;
    max-height: 500px;
    border-radius: 10px;
    border: 2px solid #f0f0f0;
    transition: border-color 0.3s ease;
}
#cropImage:hover {
    border-color: #0077ff;
}

/* Sheet preview */
#sheetWrapper {
    flex: 1;
    display: inline;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(145deg, #ffffff 0%, #f0f0f0 100%);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}
#sheetWrapper:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

#sheetWrapper h3, #cropperPanel h3{
    text-align: center;
}

#sheet {
    width: 152.4mm;
    height: 101.6mm;
    background: #ffffff;
    padding: 5mm;
    display: grid;
    grid-template-columns: repeat(4, auto);
    grid-template-rows: repeat(2, auto);
    gap: 3mm 2mm;
    border: 2px solid #ddd;
    box-sizing: border-box;
    margin: auto;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: transform 0.3s ease;
}
#sheet:hover {
    transform: scale(1.02);
}

/* Photo frame */
.photo {
    width: 34mm;
    height: 44mm;
    border: 0.3mm solid #333;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f9f9f9;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.photo:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.preview {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease, filter 0.3s ease;
}
.preview img:hover {
    filter: brightness(1.1);
}

/* Cut lines */
.cut-line {
    position: absolute;
    pointer-events: none;
}

.cut-line.vertical {
    width: 0;
    border-left: 0.2mm dashed #666;
    top: 0;
    bottom: 0;
}

.cut-line.horizontal {
    height: 0;
    border-top: 0.2mm dashed #666;
    left: 0;
    right: 0;
}

.upload-btn{
    background: linear-gradient(135deg, #0077ff 0%, #0056cc 100%) !important;
}

/* Button styles */
button, .upload-btn {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    font-weight: 500;
    padding: 12px 24px;
    margin: 5px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #06c323 0%, #da1a1a 100%);
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(63, 4, 226, 0.655);
}
button:hover, .upload-btn:hover {
    background: linear-gradient(135deg, #e1ff00 0%, #002fffce 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}
button:active, .upload-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 119, 255, 0.3);
}
button:disabled, .upload-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
}

/* Additional UI elements */
input[type="file"] {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #ffffff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
input[type="file"]:hover {
    border-color: #0077ff;
    box-shadow: 0 0 8px rgba(0, 119, 255, 0.2);
}
input[type="file"]:focus {
    outline: none;
    border-color: #0077ff;
    box-shadow: 0 0 8px rgba(0, 119, 255, 0.4);
}

/* Loading animation for images */
.preview img.loading {
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Tooltip styles (if needed) */
.tooltip {
    position: relative;
    display: inline-block;
}
.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}
.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* @media print {
    body { background: #fff; animation: none; }
    #controls { display: none !important; }
    #cropperPanel { display: none !important; }
    #layout { flex-direction: column; }
    #sheet { margin: 0; border: none; box-shadow: none; transform: none; }
    #sheetWrapper { background: none; box-shadow: none; padding: 0; }
} */

/* PRINT SETTINGS */
@media print {

   
    @page {
        size: 6in 4in;
        margin: 0;
    }

    body * {
        visibility: hidden;
    }

    #sheet,
    #sheet * {
        visibility: visible;
    }

    #sheet {
        position: absolute;
        left: 0;
        top: 0;
        width: 6in;
        height: 4in;
        margin: 0;
        padding: 0;
    }

    #controls,
    #cropperPanel,
    h2,
    h3 {
        display: none !important;
    }

}


#cropperPanel .cropper-container {
    width: 100% !important;
    max-width: 100% !important;
}
