/* Color Variables */
:root {
    /* Primary Colors */
    --primary-color: #bc7c32;
    --primary-color-dark: #9a5c26;
    --primary-color-light: #f0f2f5;
    
    /* Background Colors */
    --bg-gradient-start: #1b2552;
    --bg-gradient-end: #5c6c82;
    --bg-white: #ffffff;
    --bg-light: #f9f9f9;
    --bg-lighter: #f8f9fa;
    --bg-lightest: #f5f5f5;
    
    /* Text Colors */
    --text-primary: #1b2552;
    /* ensure it isn't 666 lol */
    --text-secondary: #667;
    --text-light: rgba(44, 62, 80, 0.7);
    --text-white: #ffffff;
    
    /* Border Colors */
    --border-primary: #bc7c32;
    --border-dark: #9a5c26;
    --border-light: #e0e0e0;
    --border-gray: #757575;
    
    /* Accent Colors */
    --accent-blue: #1a73e8;
    --accent-red: #ff4444;
    --accent-green: #4caf50;
    
    /* Radio Button Colors */
    --radio-border: #757575;
    --radio-checked: #1a73e8;
}

*
{
    font-weight: 600;
    font-family: "Poppins", sans-serif;
    box-sizing: border-box;
}
body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh; /* Ensure the body takes up at least the full viewport height */
    background: linear-gradient(to bottom, var(--bg-gradient-start), var(--bg-gradient-end));
    margin: 0;
    padding: 20px;
}

/* Submitting spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0,0,0,0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin: 10px auto 6px auto;
}

.submit-status-text {
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
.container {
    background: var(--bg-white);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 400px;
    border: 2.5px solid var(--primary-color);
    overflow-y: auto; 
    /* max-height: 90vh;  */
    margin: 0 auto;
}
h1 {
    text-align: center;
    font-size: clamp(24px, 5vw, 32px);
    margin: 0 0 15px 0;
}
.input-group {
    margin-bottom: 15px; /* Reduced from 20px to create less space */
    width: 100%;
}
label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
    font-size: clamp(14px, 3vw, 16px);
}
label span {
    color: rgb(170, 72, 72);
}
input, textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--primary-color);
    border-radius: 5px;
    font-size: clamp(14px, 3vw, 16px);
}
textarea {
    resize: none; /* Prevent resizing */
    min-height: 80px;
}
.drop-zone {
    border: 2px dashed var(--primary-color);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    border-radius: 5px;
    margin-bottom: 10px;
    background: #fafafa;
    width: 100%;
    font-size: clamp(14px, 3vw, 16px);
}
.drop-zone.dragover {
    border-color: #007bff;
}
.file-queue {
    margin-top: 10px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.file-item {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    padding: 12px 15px;
    margin-top: 0;
    border-radius: 8px;
    gap: 12px;
    border: 2px solid var(--primary-color);
    width: 100%;
    font-size: clamp(14px, 3vw, 16px);
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.file-item:hover {
    background: #f0f2f5;
    border-color: #9a5c26;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}
.file-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 4px;
    min-width: 0;
    max-width: 60%;
}

.file-name {
    font-weight: 600 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #1b2552 !important;
    font-size: clamp(15px, 3.2vw, 17px) !important;
    letter-spacing: 0.2px;
}

.file-estimates {
    display: flex;
    gap: 8px;
    font-size: 10px !important;
    color: var(--text-secondary) !important;
    flex-wrap: wrap;
    margin-top: 2px;
    max-width: 200px;
}

.estimate-item {
    color: var(--text-secondary) !important;
    font-weight: 400 !important;
    font-size: 10px !important;
    white-space: nowrap;
}

.file-item span {
    font-weight: 600;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #1b2552;
    font-size: clamp(15px, 3.2vw, 17px);
    letter-spacing: 0.2px;
}
.file-item input[type="number"] {
    width: 70px;
    padding: 6px 8px;
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    text-align: center;
    font-size: clamp(14px, 3vw, 16px);
    background: white;
    transition: all 0.2s ease;
}
.file-item input[type="number"]:focus {
    border-color: #9a5c26;
    outline: none;
    box-shadow: 0 0 0 2px rgba(188, 124, 50, 0.2);
}
.delete-btn {
    background: #fff;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}
.delete-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
    border-color: #9a5c26;
}
.submit-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: white;
    font-size: clamp(16px, 3.5vw, 18px);
    cursor: not-allowed;
    transition: background 0.3s;
    margin-top: 20px;
}
.submit-btn.active {
    background: var(--accent-green);
    cursor: pointer;
}
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--accent-red);
    color: var(--text-white);
    padding: 15px;
    border-radius: 5px;
    display: none;
    font-size: clamp(14px, 3vw, 16px);
    max-width: 90%;
    z-index: 1000;
}
.laser-cut-prompt {
    /* text-align: center; */
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9; /* Light background for contrast */
    border-radius: 5px;
    border: 1px solid #000; 
}

.laser-cut-prompt h3 {
    margin: 0;
    font-size: clamp(14px, 3vw, 16px);
    color: #1b2552; /* Dark blue to match the form's theme */
}

.laser-cut-link {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: var(--text-white);
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    font-size: clamp(14px, 3vw, 16px);
    transition: background-color 0.3s ease;
}

.laser-cut-link:hover {
    background-color: var(--primary-color-dark);
}

/* Back Button Styles */
.back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    display: inline-block;
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: var(--text-white);
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: clamp(14px, 3.5vw, 18px);
    transition: all 0.3s ease;
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.back-btn:hover {
    background-color: var(--primary-color-dark);
    border-color: var(--primary-color-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Responsive adjustments for back button */
@media screen and (max-width: 768px) {
    .back-btn {
        top: 15px;
        left: 15px;
        padding: 10px 16px;
        font-size: clamp(13px, 3vw, 16px);
    }
}

@media screen and (max-width: 480px) {
    .back-btn {
        top: 10px;
        left: 10px;
        padding: 8px 12px;
        font-size: clamp(12px, 2.8vw, 14px);
        border-radius: 6px;
    }
}

@media screen and (max-width: 320px) {
    .back-btn {
        top: 8px;
        left: 8px;
        padding: 6px 10px;
        font-size: clamp(11px, 2.5vw, 13px);
    }
}

/* Template Section Styles */
.template-section {
    /* text-align: center; */
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9; /* Light background for contrast */
    border-radius: 5px;
    border: 1px solid #000; 
}

.template-section h3 {
    margin: 0;
    font-size: clamp(14px, 3vw, 16px);
    color: #1b2552; /* Dark blue to match the form's theme */
    /* text-decoration: underline; */
}

.template-link {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: var(--text-white);
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    font-size: clamp(14px, 3vw, 16px);
    transition: background-color 0.3s ease;
}

.template-link:hover {
    background-color: var(--primary-color-dark);
}

/* Color Selection Styles */
.color-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.color-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.color-option input[type="radio"] {
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
    appearance: none;
    border: 2px solid var(--radio-border);
    border-radius: 50%;
    position: relative;
}

.color-option input[type="radio"]:checked {
    border-color: var(--radio-checked);
}

.color-option input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background-color: var(--radio-checked);
    border-radius: 50%;
}

.color-option label {
    flex: 1;
    cursor: pointer;
    font-weight: normal;
    margin: 0;
    font-size: 14px;
    color: #202124;
}

/* Hover effect */
.color-option:hover {
    background-color: #f8f9fa;
    border-radius: 4px;
}

#three-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 150px;
    height: 150px;
    background-color: transparent;
    z-index: 1000;
    display: none; /* Hide by default */
}

.file-section {
    margin: 15px 0;
}

.file-section h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #1b2552;
}

/* Popup Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    padding: 20px;
}

.popup-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px;
    text-align: center;
    border: 2.5px solid var(--primary-color);
}

.popup-content h2 {
    color: #1b2552;
    margin-bottom: 15px;
    font-size: clamp(20px, 4vw, 24px);
}

.popup-content h3 {
    color: #666;
    margin-bottom: 20px;
    font-size: clamp(16px, 3vw, 18px);
}

.submission-details {
    text-align: left;
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.submitted-file {
    display: flex;
    align-items: center;
    margin: 10px 0;
    padding: 10px;
    background: #fff;
    border-radius: 5px;
    border: 1px solid var(--primary-color);
    font-size: clamp(14px, 3vw, 16px);
}

.submitted-file:before {
    content: "✓";
    color: green;
    margin-right: 10px;
    font-weight: bold;
}

.restart-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-size: clamp(16px, 3.5vw, 18px);
    font-weight: bold;
    transition: background-color 0.3s;
    margin-top: 20px;
}

.restart-btn:hover {
    background: #9a5c26;
}

/* Media Queries */
@media screen and (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
        margin: 10px auto;
    }

    .file-item {
        flex-direction: row;
        align-items: center;
        padding: 10px 12px;
        gap: 8px;
        border-width: 1.5px;
    }

    .file-item span {
        font-size: clamp(14px, 3vw, 16px);
    }

    .file-item input[type="number"] {
        width: 60px;
        padding: 5px 6px;
    }

    .delete-btn {
        width: 28px;
        height: 28px;
        font-size: 16px;
        border-width: 1.5px;
    }

    .notification {
        left: 20px;
        right: 20px;
        bottom: 10px;
    }

    .popup-content {
        padding: 20px;
    }
}

@media screen and (max-width: 320px) {
    .container {
        padding: 10px;
    }

    .file-item {
        padding: 8px 10px;
        border-width: 1px;
    }

    .file-item input[type="number"] {
        width: 50px;
        padding: 4px 5px;
    }

    .delete-btn {
        width: 26px;
        height: 26px;
        font-size: 14px;
        border-width: 1px;
    }

    .submit-btn, .restart-btn {
        padding: 10px 20px;
    }
}

/* Landscape Mode */
@media screen and (max-height: 600px) and (orientation: landscape) {
    .container {
        margin: 10px auto;
    }

    .file-item {
        padding: 8px;
    }

    .popup-content {
        padding: 15px;
    }

    .submission-details {
        margin: 10px 0;
    }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .container {
        border-width: 2px;
    }

    .file-item {
        border-width: 1px;
    }
}

/* Print Styles */
@media print {
    body {
        background: none;
    }

    .container {
        box-shadow: none;
        border: none;
        margin: 0;
        padding: 0;
    }

    .submit-btn, .delete-btn, .restart-btn {
        display: none;
    }

    .drop-zone {
        border: none;
        background: none;
    }
}

.radio-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.radio-option input[type="radio"] {
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
    appearance: none;
    border: 2px solid var(--radio-border);
    border-radius: 50%;
    position: relative;
}

.radio-option input[type="radio"]:checked {
    border-color: var(--radio-checked);
}

.radio-option input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background-color: var(--radio-checked);
    border-radius: 50%;
}

.radio-option label {
    flex: 1;
    cursor: pointer;
    font-weight: normal;
    margin: 0;
    font-size: 14px;
    color: #202124;
}

/* Hover effect */
.radio-option:hover {
    background-color: #f8f9fa;
    border-radius: 4px;
}

.other-input {
    flex-grow: 1;
    padding: 6px 8px;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    font-size: clamp(14px, 3vw, 16px);
    transition: all 0.2s ease;
}

.other-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.other-input:enabled {
    border-color: var(--primary-color);
}

/* Mobile-specific styles */
@media screen and (max-width: 480px) {
    .radio-option {
        padding: 3px 0;
    }

    .radio-option input[type="radio"] {
        width: 18px;
        height: 18px;
    }

    .radio-option label {
        font-size: clamp(13px, 2.8vw, 15px);
    }

    .other-input {
        padding: 5px 6px;
    }
}

@media screen and (max-width: 320px) {
    .radio-option {
        padding: 2px 0;
    }

    .radio-option input[type="radio"] {
        width: 16px;
        height: 16px;
    }

    .radio-option label {
        font-size: clamp(12px, 2.6vw, 14px);
    }

    .other-input {
        padding: 4px 5px;
    }
}

.dimension-note {
    color: var(--text-light);
    font-size: clamp(12px, 2.5vw, 14px);
    margin: 4px 0 8px 0;
    font-style: italic;
    line-height: 1.4;
}

/* Mobile-specific styles */
@media screen and (max-width: 480px) {
    .dimension-note {
        font-size: clamp(11px, 2.3vw, 13px);
        margin: 3px 0 6px 0;
    }
}

@media screen and (max-width: 320px) {
    .dimension-note {
        font-size: clamp(10px, 2.1vw, 12px);
        margin: 2px 0 4px 0;
    }
}

/* Cancel page styles */
.cancel-message {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: var(--bg-lightest);
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.cancel-message h3 {
    color: var(--text-primary);
    margin: 0 0 15px 0;
    font-size: clamp(18px, 4vw, 22px);
    font-weight: 600;
}

.cancel-message p {
    color: var(--text-secondary);
    margin: 0;
    font-size: clamp(14px, 3vw, 16px);
    line-height: 1.5;
    font-weight: normal;
}

/* Mobile-specific styles for cancel page */
@media screen and (max-width: 480px) {
    .cancel-message {
        margin: 20px 0;
        padding: 15px;
    }
    
    .cancel-message h3 {
        font-size: clamp(16px, 3.5vw, 20px);
    }
    
    .cancel-message p {
        font-size: clamp(13px, 2.8vw, 15px);
    }
}

@media screen and (max-width: 320px) {
    .cancel-message {
        margin: 15px 0;
        padding: 12px;
    }
    
    .cancel-message h3 {
        font-size: clamp(15px, 3.2vw, 18px);
    }
    
    .cancel-message p {
        font-size: clamp(12px, 2.6vw, 14px);
    }
}
