:root {
    --primary-dark: #1a1a1a;
    --accent-color: #f26622; /* Optional accent */
    --bg-color: #f4f7f6;
    --border-color: #ddd;
    --label-width: 4in;
    --label-height: 6in;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--primary-dark);
}

.app-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-weight: 800;
    font-size: 24px;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: #fafafa;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.upload-zone.dragover {
    background: #eef5ff;
    border-color: #4285f4;
}

.upload-content p {
    margin: 10px 0;
    font-weight: 600;
}

.text-small {
    font-size: 14px;
    color: #666;
}

.error-message {
    color: #d93025;
    background: #fce8e6;
    padding: 10px;
    border-radius: 6px;
    margin: 20px 0;
    font-weight: 600;
    text-align: center;
}

/* Buttons */
.btn {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.btn.primary {
    background: var(--primary-dark);
    color: #fff;
}

.btn.primary:hover {
    background: #000;
}

.btn.secondary {
    background: #eee;
    color: #333;
}

.btn.secondary:hover {
    background: #ddd;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Preview Section */
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0 15px;
}

.preview-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.preview-canvas-wrapper {
    display: flex;
    justify-content: center;
    padding: 20px;
    background: #eaeaea;
    border-radius: 8px;
    overflow-x: auto;
}

/* Label Styling (Screen & Print) */
.label-card {
    width: var(--label-width);
    height: var(--label-height);
    background: #fff;
    border: 4px solid var(--primary-dark);
    border-radius: 16px;
    padding: 0;
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.label-header {
    position: relative;
    display: flex;
    justify-content: center;
    margin-top: 10px;
    margin-bottom: 15px;
}

.header-center {
    text-align: center;
}

.speed-post {
    font-size: 20px;
    font-weight: 900;
    text-decoration: underline;
}

.order-id {
    font-size: 10px;
    font-weight: 800;
    text-decoration: underline;
}

.header-right {
    position: absolute;
    right: 0;
    top: 0;
}

.logo-img {
    width: 75px;
    height: auto;
}

.content-wrapper {
    padding: 0 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.ship-to-block {
    width: 75%;
}

.to-label {
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 5px;
}

.customer-name {
    font-size: 22px;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1.1;
}

.customer-address {
    font-size: 14px;
    font-weight: 700;
    margin-top: 5px;
    line-height: 1.2;
}

.customer-phone {
    font-size: 16px;
    font-weight: 900;
    margin-top: 5px;
}

.barcode-zone {
    flex-grow: 1;
    width: 100%;
    margin: 15px 0;
}

.bottom-section {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
}

.bottom-left {
    width: 70%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.bottom-right {
    width: 30%;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
}

.fragile-and-website {
    display: flex;
    align-items: stretch;
    margin-bottom: 10px;
    gap: 10px;
}

.fragile-img {
    height: 100px;
    width: auto;
}

.website-box {
    background: #000;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0px 41px;
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    border-radius: 4px;
    margin-top: 66px;
}

.contact-info {
    font-size: 9px;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 10px;
}

.from-label {
    font-size: 14px;
    font-weight: 900;
}

.qr-img {
    width: 100%;
    max-width: 100px;
    height: auto;
}

.from-details {
    border-top: 2px solid #000;
    padding: 10px 15px;
    background: #fff;
}

.sender-name {
    font-size: 13px;
    font-weight: 800;
}

.sender-address {
    font-size: 9px;
    font-weight: 600;
}

#print-container {
    display: none; /* Hidden on screen by default */
}

/* Print CSS */
@media print {
    @page {
        size: 4in 6in;
        margin: 0;
    }

    body {
        background: none;
    }

    .no-print {
        display: none !important;
    }

    #print-container {
        display: block !important;
    }

    .label-card {
        width: 3.8in;
        height: 5.8in;
        margin: 0.1in;
        border-width: 3px; /* Slightly thinner for print clarity */
        border-radius: 12px;
        page-break-after: always;
        box-shadow: none;
    }

    /* Remove barcode styling for print */
    .barcode-zone {
        border: none !important;
        color: transparent !important;
        background: transparent !important;
    }
    
    .barcode-zone::after {
        content: "";
    }
}
