/* ===================================
   Cabinet Door Calculator Styles
   Mobile-First Design - Improved
   =================================== */
   
   
   
   
   
   
   

/* Reset and Base Styles */
* {
    box-sizing: border-box;
}

.calculator-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #333;
    line-height: 1.6;
}

/* Settings Panel */
.settings-panel {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.settings-panel h2 {
    margin: 0 0 20px 0;
    font-size: 1.5rem;
    color: #2c3e50;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.setting-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
    font-size: 0.95rem;
}

.fraction-input {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.whole-input {
    flex: 1;
    min-width: 0;
    padding: 12px;
    font-size: 1rem;
    border: 2px solid #ced4da;
    border-radius: 6px;
    transition: border-color 0.3s;
}

.fraction-select {
    flex: 1;
    min-width: 0;
    padding: 12px;
    font-size: 1rem;
    border: 2px solid #ced4da;
    border-radius: 6px;
    background: white;
    transition: border-color 0.3s;
    cursor: pointer;
}

.whole-input:focus,
.fraction-select:focus {
    outline: none;
    border-color: #4a90e2;
}

.setting-item input:not(.whole-input) {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 2px solid #ced4da;
    border-radius: 6px;
    transition: border-color 0.3s;
}

.setting-item input:not(.whole-input):focus {
    outline: none;
    border-color: #4a90e2;
}

/* Input Section */
.input-section {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.tab-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    background: #e9ecef;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #4a90e2;
    color: white;
    border-color: #4a90e2;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.input-form {
    margin-top: 20px;
}

/* Form Row and Groups */
.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
    font-size: 0.95rem;
}

.form-group .fraction-input {
    display: flex;
    gap: 8px;
    align-items: center;
}

.form-group input:not(.whole-input) {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 2px solid #ced4da;
    border-radius: 6px;
    transition: border-color 0.3s;
}

.form-group input:not(.whole-input):focus {
    outline: none;
    border-color: #4a90e2;
}

/* Ensure quantity input is always visible */
#door-quantity {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 2px solid #ced4da;
    border-radius: 6px;
    transition: border-color 0.3s;
    display: block !important;
    visibility: visible !important;
}

#door-quantity:focus {
    outline: none;
    border-color: #4a90e2;
}

#bulk-input {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 2px solid #ced4da;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    resize: vertical;
    margin-top: 8px;
}

#bulk-input:focus {
    outline: none;
    border-color: #4a90e2;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    white-space: nowrap;
}

.btn-primary {
    background: #4a90e2;
    color: white;
}

.btn-primary:hover {
    background: #357abd;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-action {
    background: #28a745;
    color: white;
}

.btn-action:hover {
    background: #218838;
}

/* Project List Section */
.project-list-section {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.section-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #2c3e50;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.action-buttons .btn {
    padding: 10px 16px;
    font-size: 0.9rem;
}

.doors-list {
    margin-top: 20px;
}

.empty-state,
.loading-state {
    text-align: center;
    color: #6c757d;
    padding: 40px 20px;
    font-style: italic;
}

.doors-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.door-card {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
}

.door-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.door-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #2c3e50;
}

.btn-remove {
    background: #dc3545;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.3s;
    padding: 0;
    flex-shrink: 0;
}

.btn-remove:hover {
    background: #c82333;
}

.door-info p,
.door-parts p {
    margin: 8px 0;
    font-size: 0.95rem;
}

.door-info strong,
.door-parts strong {
    color: #495057;
}

/* Cut List Section */
.cutlist-section {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.master-cutlist {
    margin-top: 20px;
}

.cutlist-tables {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.cutlist-table {
    min-width: 0;
}

.cutlist-table h3 {
    margin: 0 0 12px 0;
    font-size: 1.2rem;
    color: #2c3e50;
    border-bottom: 2px solid #4a90e2;
    padding-bottom: 8px;
}

.cutlist-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.cutlist-table thead {
    background: #4a90e2;
    color: white;
}

.cutlist-table th,
.cutlist-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.cutlist-table th {
    font-weight: 600;
    font-size: 0.95rem;
}

.cutlist-table td {
    font-size: 0.95rem;
}

.cutlist-table tbody tr:hover {
    background: #f8f9fa;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    padding: 20px;
}

.modal-content {
    background: white;
    margin: 50px auto;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    font-weight: bold;
    color: #adb5bd;
    cursor: pointer;
    line-height: 1;
    border: none;
    background: none;
}

.modal-close:hover {
    color: #495057;
}

.modal-content h3 {
    margin: 0 0 20px 0;
    font-size: 1.5rem;
    color: #2c3e50;
}

.modal-content p {
    margin: 0 0 20px 0;
    color: #6c757d;
}

.modal-input {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 2px solid #ced4da;
    border-radius: 6px;
    margin-bottom: 20px;
}

.modal-input:focus {
    outline: none;
    border-color: #4a90e2;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* My Projects / Saved Projects Section */
.saved-projects-section,
.my-projects-section {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.saved-projects-section h2,
.my-projects-section h2 {
    margin: 0 0 20px 0;
    font-size: 1.5rem;
    color: #2c3e50;
}

.projects-list {
    margin-top: 20px;
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.project-card {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    padding: 20px;
}

.project-card h3 {
    margin: 0 0 8px 0;
    font-size: 1.2rem;
    color: #2c3e50;
    word-break: break-word;
}

.project-date {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0 0 15px 0;
}

.project-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.project-actions .btn {
    flex: 1;
    min-width: 100px;
}

/* Tablet Styles - 768px and up */
@media (min-width: 768px) {
    .calculator-container {
        padding: 25px;
    }
    
    .settings-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .form-row {
        grid-template-columns: 2fr 2fr 1fr;
        align-items: end;
    }
    
    .tab-buttons {
        max-width: 400px;
    }
    
    .doors-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cutlist-tables {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .action-buttons {
        flex-wrap: nowrap;
    }
}

/* Desktop Styles - 1024px and up */
@media (min-width: 1024px) {
    .calculator-container {
        padding: 30px;
    }
    
    .settings-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .doors-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .cutlist-tables {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .section-header {
        flex-wrap: nowrap;
    }
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }
    
    .cutlist-section,
    .cutlist-section * {
        visibility: visible;
    }
    
    .cutlist-section {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    
    .settings-panel,
    .input-section,
    .project-list-section,
    .action-buttons,
    .btn,
    .modal {
        display: none !important;
    }
    
    .cutlist-table table {
        page-break-inside: avoid;
    }
    
    .cutlist-table {
        margin-bottom: 30px;
    }
    
    .section-header h2 {
        font-size: 2rem;
        margin-bottom: 20px;
    }
}




/* ADD THIS CSS TO YOUR calculator.css FILE */
/* Add it after the .input-section styles */

/* Panel Layout Guide */
.panel-layout-guide {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.panel-layout-guide h4 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    color: #2c3e50;
    text-align: center;
}

.layout-examples {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.layout-example {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.layout-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    text-align: center;
}

.layout-diagram {
    width: 100%;
    max-width: 120px;
    aspect-ratio: 3/4;
}

.diagram-border {
    width: 100%;
    height: 100%;
    border: 3px solid #2c3e50;
    border-radius: 4px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.panel {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #90caf9;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #1976d2;
    font-size: 1.2rem;
}

.single-panel .panel {
    flex: 1;
}

.two-horizontal .panel {
    flex: 1;
}

.two-horizontal .middle-rail {
    height: 4px;
    background: #6c757d;
    margin: 4px 0;
    flex-shrink: 0;
}

.panel-row {
    display: flex;
    flex: 1;
    gap: 4px;
}

.two-vertical .panel-row {
    gap: 0;
}

.two-vertical .middle-stile {
    width: 4px;
    background: #6c757d;
    flex-shrink: 0;
}

.two-vertical .panel {
    flex: 1;
}

.four-panel .panel-row {
    gap: 0;
}

.four-panel .middle-rail {
    height: 4px;
    background: #6c757d;
    margin: 4px 0;
    flex-shrink: 0;
}

.four-panel .middle-stile {
    width: 4px;
    background: #6c757d;
    flex-shrink: 0;
}

.four-panel .panel.small {
    flex: 1;
}

/* ADD THIS TO YOUR EXISTING TABLET MEDIA QUERY (around @media (min-width: 768px)) */
/* Find the tablet styles section and add this line: */

.layout-examples {
    grid-template-columns: repeat(4, 1fr);
}

