/* Design Page Styles */
.design-header {
    padding: 150px 0 50px;
    background: linear-gradient(135deg, var(--primary-black) 0%, var(--gray-dark) 100%);
    color: var(--white);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.design-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,215,0,0.03)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
    pointer-events: none;
}

.page-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--white) 0%, var(--primary-yellow) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-subtitle {
    font-size: 1.3rem;
    color: var(--yellow-light);
    font-weight: 300;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s ease-out;
}

/* Design Tool Section */
.design-tool {
    padding: 3rem 0;
    background: var(--white);
}

.design-layout {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 2rem;
    align-items: stretch;
}

.design-form-section {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: box-shadow 0.3s ease;
}

.design-form-section:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.design-preview-section {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: box-shadow 0.3s ease;
}

.design-preview-section:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.design-form-section h2 {
    font-size: 1.6rem;
    color: var(--primary-black);
    margin-bottom: 1.5rem;
    border-bottom: 3px solid var(--primary-yellow);
    padding-bottom: 0.5rem;
}

.design-preview-section h2 {
    font-size: 1.8rem;
    color: var(--primary-black);
    margin-bottom: 1.5rem;
    border-bottom: 3px solid var(--primary-yellow);
    padding-bottom: 0.5rem;
}

/* Form Styles */

.design-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    text-align: left;
    flex: 1;
    justify-content: space-between;
}

.design-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.design-form label {
    font-weight: 600;
    color: var(--primary-black);
    font-size: 1rem;
    margin-bottom: 0.4rem;
}

.design-form input[type="text"],
.design-form select {
    padding: 13px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--white);
    width: 100%;
}

.design-form input[type="text"]:focus,
.design-form select:focus {
    outline: none;
    border-color: var(--primary-yellow);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.15);
    background: var(--white);
}

.design-form input[type="color"] {
    width: 100%;
    height: 55px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    padding: 5px;
}

.design-form input[type="color"]:hover {
    border-color: var(--primary-yellow);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.char-count {
    font-size: 0.85rem;
    color: var(--gray-medium);
    text-align: right;
    margin-top: 0.3rem;
}

/* Height Options */
.height-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.9rem;
    margin-top: 0.5rem;
}

.height-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.7rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    background: var(--white);
    font-size: 0.95rem;
}

.height-option:hover {
    border-color: var(--primary-yellow);
    background: var(--yellow-light);
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(255, 215, 0, 0.2);
}

.height-option input[type="radio"] {
    display: none;
}

.height-option input[type="radio"]:checked + span {
    color: var(--primary-black);
    font-weight: 700;
}

.height-option:has(input[type="radio"]:checked) {
    border-color: var(--primary-yellow);
    background: var(--primary-yellow);
    box-shadow: 0 3px 15px rgba(255, 215, 0, 0.3);
    transform: translateY(-2px);
}

.height-option span {
    font-size: 0.95rem;
    color: var(--gray-medium);
    transition: var(--transition);
    font-weight: 500;
}

/* Form Button */
.design-form button[type="submit"],
.design-form .btn-primary {
    padding: 15px 30px;
    background: var(--primary-yellow);
    color: var(--primary-black);
    border: 2px solid var(--primary-yellow);
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1rem;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Poppins', sans-serif;
}

.design-form button[type="submit"]:hover,
.design-form .btn-primary:hover {
    background: var(--yellow-dark);
    border-color: var(--yellow-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

/* Preview Section */
.preview-container {
    background: transparent;
    border-radius: 10px;
    padding: 0;
    margin-bottom: 0;
    text-align: center;
}

/* Form Container - Same as Preview Container */
.form-container {
    background: transparent;
    border-radius: 10px;
    padding: 0;
    margin-bottom: 0;
    text-align: center;
}

.form-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
    display: inline-block;
    width: 100%;
    max-width: 1200px;
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
    border-radius: 10px;
    padding: 20px;
}

.canvas-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
    display: inline-block;
    width: 100%;
    max-width: 1200px;
    background: #f9f9f9;
    border-radius: 10px;
    padding: 20px;
}

#previewCanvas {
    width: 100%;
    max-width: 1200px;
    height: auto;
    min-height: 200px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: var(--white);
    display: block;
    margin: 0 auto;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    aspect-ratio: 4 / 1;
}

.canvas-wrapper {
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
}

.measurement-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.measurement-line {
    position: absolute;
    pointer-events: none;
}

.measurement-line.horizontal {
    border-top: 2px dashed;
    width: 100%;
}

.measurement-line.vertical {
    border-left: 2px dashed;
    height: 100%;
}

.measurement-label {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.measurement-label.red {
    color: #ff0000;
}

.measurement-label.green {
    color: #00aa00;
}

.measurement-label.gray {
    color: #666;
}

.preview-measurements {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.measure-item {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.measure-label {
    color: var(--gray-medium);
    font-size: 0.9rem;
}

.measure-value {
    color: var(--primary-black);
    font-weight: 600;
    font-size: 1rem;
}

.preview-info {
    text-align: center;
}

.preview-text {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-black);
    margin-bottom: 0.5rem;
    font-family: 'Arial', sans-serif;
}

.preview-size {
    font-size: 1rem;
    color: var(--gray-medium);
    margin-bottom: 0.5rem;
}

/* Price Section */
.price-section {
    background: var(--white);
    border-radius: 10px;
    padding: 2rem;
    margin-top: 2rem;
    border: 2px solid var(--primary-yellow);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

/* API Loader */
.api-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gray-light);
    border-top: 4px solid var(--primary-yellow);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.api-loader p {
    color: var(--gray-medium);
    font-size: 1rem;
}

.api-response {
    display: none;
}

.price-warning {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #856404;
    font-size: 0.9rem;
}

.price-warning span {
    font-size: 1.2rem;
}

.price-section h3 {
    font-size: 1.5rem;
    color: var(--primary-black);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--primary-yellow);
    padding-bottom: 0.5rem;
}

.price-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.price-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.price-item span:first-child {
    color: var(--gray-medium);
}

.price-item span:last-child {
    font-weight: 600;
    color: var(--primary-black);
}

.price-total {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    margin-top: 1rem;
    border-top: 2px solid var(--primary-yellow);
    font-size: 1.3rem;
    font-weight: 700;
}

.price-total span:last-child {
    color: var(--primary-yellow);
    font-size: 1.5rem;
}

/* Price Modal */
.price-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.price-modal .modal-content.price-modal-content {
    background: var(--white);
    border-radius: 20px;
    padding: 0;
    max-width: 600px;
    width: 100%;
    max-height: 95vh;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
    overflow: hidden;
    margin: 2rem auto;
    display: flex;
    flex-direction: column;
}

.price-modal-content-wrapper {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.price-modal-content-wrapper::-webkit-scrollbar {
    width: 8px;
}

.price-modal-content-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.price-modal-content-wrapper::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.price-modal-content-wrapper::-webkit-scrollbar-thumb:hover {
    background: #555;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Performance optimizations */
.price-modal {
    will-change: opacity, transform;
    backface-visibility: hidden;
}

.price-modal-content {
    will-change: transform;
    transform: translateZ(0);
}

.price-modal-header {
    background: linear-gradient(135deg, var(--primary-yellow) 0%, var(--yellow-dark) 100%);
    padding: 2rem 2.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--primary-black);
}

.price-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.price-modal-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    border: none;
    padding: 0;
    color: var(--primary-black);
}

.price-modal-content .close-modal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 2rem;
    color: var(--primary-black);
    background: rgba(255, 255, 255, 0.3);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
}

.price-modal-content .close-modal:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg);
}

.price-warning-modal {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
    border-left: 4px solid #ffc107;
    border-radius: 0;
    padding: 1.2rem 2.5rem;
    margin: 0;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    color: #856404;
    font-size: 0.95rem;
    line-height: 1.6;
}

.warning-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.warning-text {
    flex: 1;
}

.warning-text strong {
    color: #856404;
    font-weight: 700;
}

.price-details-modal {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 2rem 2.5rem 1.5rem 2.5rem;
    background: var(--white);
    flex-shrink: 0;
}

.price-item-modal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.price-item-modal:last-of-type {
    border-bottom: none;
    padding-bottom: 0.5rem;
}

.price-label {
    color: var(--gray-medium);
    font-weight: 500;
    font-size: 1rem;
}

.price-value {
    font-weight: 600;
    color: var(--primary-black);
    font-size: 1rem;
}

.price-total-modal {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 1.8rem 2.5rem !important;
    margin: 0 !important;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%) !important;
    border-left: 4px solid #2196f3 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 1 !important;
    flex-shrink: 0;
}

.price-total-modal .price-label {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-black);
    display: block;
}

.price-value-total {
    color: #1976d2 !important;
    font-size: 2.2rem !important;
    font-weight: 700 !important;
    text-shadow: 0 2px 4px rgba(25, 118, 210, 0.2) !important;
    display: inline-block !important;
    min-width: 120px !important;
    visibility: visible !important;
    opacity: 1 !important;
    line-height: 1.2 !important;
    text-align: right !important;
}

.price-info-note {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #90caf9;
    border-left: 4px solid #2196f3;
    border-radius: 0;
    padding: 1.2rem 2.5rem;
    margin: 0;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    flex-shrink: 0;
}

.price-warning-modal {
    flex-shrink: 0;
}

.price-details-modal {
    flex-shrink: 0;
}

.price-info-note .info-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 0.2rem;
}

.price-info-note .info-content {
    flex: 1;
}

.price-info-note .info-content p {
    margin: 0 0 0.8rem 0;
    font-weight: 600;
    color: var(--primary-black);
    font-size: 1rem;
}

.price-info-note .info-content ul {
    margin: 0;
    padding-left: 1.2rem;
    list-style: none;
}

.price-info-note .info-content ul li {
    margin-bottom: 0.6rem;
    color: #1565c0;
    font-size: 0.9rem;
    line-height: 1.5;
    position: relative;
    padding-left: 1rem;
}

.price-info-note .info-content ul li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #2196f3;
    font-weight: bold;
    font-size: 1.2rem;
}

.price-info-note .info-content ul li:last-child {
    margin-bottom: 0;
}

.price-info-note .info-content strong {
    color: var(--primary-black);
    font-weight: 600;
}

.btn-modal {
    margin: 0;
    padding: 18px 40px;
    font-size: 1.1rem;
    border-radius: 0;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
    flex-shrink: 0;
    width: 100%;
    border: none;
}

/* Order Modal */
.order-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.order-modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 15px;
    padding: 2.5rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 2rem;
    color: var(--gray-medium);
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--primary-black);
}

.modal-content h2 {
    font-size: 2rem;
    color: var(--primary-black);
    margin-bottom: 1.5rem;
    border-bottom: 3px solid var(--primary-yellow);
    padding-bottom: 0.5rem;
}

.order-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.order-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.order-form label {
    font-weight: 600;
    color: var(--primary-black);
}

.order-form input,
.order-form textarea {
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
}

.order-form input:focus,
.order-form textarea:focus {
    outline: none;
    border-color: var(--primary-yellow);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.order-summary {
    background: var(--gray-light);
    padding: 1.5rem;
    border-radius: 10px;
    margin: 1rem 0;
}

.order-summary h3 {
    font-size: 1.3rem;
    color: var(--primary-black);
    margin-bottom: 1rem;
}

.order-summary p {
    margin-bottom: 0.5rem;
    color: var(--gray-medium);
}

.order-summary strong {
    color: var(--primary-black);
}

/* Responsive */
@media (max-width: 1024px) {
    .design-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .design-form-section,
    .design-preview-section {
        height: auto;
    }
    
    .price-modal {
        padding: 1rem;
    }
    
    .price-modal-content {
        max-width: 90%;
    }
}

@media (max-width: 768px) {
    .design-header {
        padding: 120px 0 40px;
    }
    
    .page-title {
        font-size: 2.5rem;
    }
    
    .page-subtitle {
        font-size: 1.1rem;
    }
    
    .design-tool {
        padding: 2rem 0;
    }
    
    .design-layout {
        gap: 1.5rem;
    }
    
    .design-form-section,
    .design-preview-section {
        padding: 1.5rem;
    }
    
    .design-form-section h2 {
        font-size: 1.3rem;
    }
    
    .design-preview-section h2 {
        font-size: 1.5rem;
    }
    
    .height-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.7rem;
    }
    
    .height-option {
        padding: 0.8rem 0.5rem;
        font-size: 0.9rem;
    }
    
    .price-modal-content {
        max-width: 95%;
        border-radius: 15px;
    }
    
    .price-modal-header {
        padding: 1.5rem;
    }
    
    .price-details-modal {
        padding: 1.5rem;
    }
    
    .price-info-note {
        padding: 1rem;
        margin: 1rem 0;
    }
}

@media (max-width: 480px) {
    .design-header {
        padding: 100px 0 30px;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
    }
    
    .design-form-section,
    .design-preview-section {
        padding: 1rem;
        border-radius: 10px;
    }
    
    .height-options {
        grid-template-columns: 1fr;
    }
    
    .height-option {
        padding: 0.9rem;
    }
    
    #previewCanvas {
        width: 100%;
        height: auto;
    }
    
    .canvas-wrapper {
        padding: 0.5rem;
    }
    
    .measurement-label {
        font-size: 9px;
        padding: 1px 4px;
    }
    
    .preview-measurements {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .price-modal {
        padding: 0.5rem;
    }
    
    .price-modal-content {
        max-width: 100%;
        border-radius: 10px;
    }
    
    .price-modal-header {
        padding: 1rem;
        flex-wrap: wrap;
    }
    
    .price-icon {
        font-size: 2rem;
    }
    
    .price-modal-header h2 {
        font-size: 1.4rem;
    }
    
    .price-details-modal {
        padding: 1rem;
    }
    
    .price-info-note {
        padding: 0.8rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .price-info-note .info-content ul {
        padding-left: 1rem;
    }
    
    .btn-modal {
        margin: 1rem;
        padding: 14px 30px;
        font-size: 1rem;
    }
}

