/*
 * Photo Printing App v158
 * Fixed Image Grid Modal Display Issues
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    overflow-x: hidden;
}

/* Main Content Area */
.main-content {
    min-height: 100vh;
    padding-bottom: 80px; /* Space for bottom bar */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Welcome Screen */
.welcome-screen {
    text-align: center;
    color: #666;
}

.welcome-content {
    max-width: 600px;
}

.welcome-icon {
    font-size: 64px;
    color: #007bff;
    margin-bottom: 20px;
}

.welcome-content h2 {
    font-size: 28px;
    color: #333;
    margin-bottom: 10px;
}

.welcome-content p {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
}

/* Paper Size Selection */
.paper-size-selection {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    margin-top: 20px;
}

.paper-size-selection h3 {
    font-size: 20px;
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
}

.paper-size-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    max-width: 100%;
}

.paper-size-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 16px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.paper-size-btn:hover {
    background: #e3f2fd;
    border-color: #2196f3;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(33, 150, 243, 0.2);
}

.paper-size-btn.active {
    background: #2196f3;
    border-color: #2196f3;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(33, 150, 243, 0.3);
}

.paper-preview {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.paper-size-btn.active .paper-preview {
    background: rgba(255,255,255,0.9);
}

.paper-ratio {
    background: #ddd;
    border: 1px solid #bbb;
    border-radius: 2px;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}

.paper-size-btn.active .paper-ratio {
    background: #2196f3;
    border-color: #1976d2;
}

/* Welcome Screen Dropdown Paper Size Selection */
.paper-size-dropdown-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.paper-size-dropdown-welcome {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    font-size: 16px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.paper-size-dropdown-welcome:hover {
    border-color: #2196f3;
}

.paper-size-dropdown-welcome:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.current-paper-info-welcome {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.paper-preview-welcome {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 6px;
    padding: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.paper-ratio-welcome {
    background: #2196f3;
    border: 1px solid #1976d2;
    border-radius: 2px;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}

.paper-info-welcome {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.paper-name-welcome {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.paper-dimensions-welcome {
    font-size: 14px;
    color: #666;
}

/* Mobile responsive for paper selection */
@media (max-width: 768px) {
    .paper-size-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .paper-size-btn {
        padding: 12px 8px;
        font-size: 12px;
    }
    
    .paper-preview {
        width: 50px;
        height: 50px;
    }
    
    .welcome-content {
        max-width: 90%;
    }
    
    .paper-size-selection {
        padding: 20px;
        margin: 20px 10px 0;
    }
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* Main Interface */
.main-interface {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

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

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.1rem;
    color: #6c757d;
}

/* Paper Selection */
.paper-selection {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.paper-selection h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.paper-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.paper-option {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.paper-option:hover {
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0,123,255,0.15);
}

.paper-option.active {
    border-color: #007bff;
    background: #f0f8ff;
}

.paper-preview {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60px;
}

.paper-rect {
    background: #dee2e6;
    border-radius: 2px;
    width: 30px;
    height: 40px;
}

.paper-rect.larger {
    width: 35px;
    height: 45px;
}

.paper-rect.large {
    width: 40px;
    height: 50px;
}

.paper-info h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.paper-info p {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.price {
    font-weight: 600;
    color: #007bff;
}

/* Finish Options */
.finish-options h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.finish-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.finish-option {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    padding: 15px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.finish-option:hover {
    border-color: #007bff;
}

.finish-option.active {
    border-color: #007bff;
    background: #f0f8ff;
}

.finish-preview {
    width: 40px;
    height: 30px;
    border-radius: 3px;
    margin: 0 auto 10px;
}

.finish-preview.glossy {
    background: linear-gradient(135deg, #fff 0%, #e9ecef 100%);
}

.finish-preview.matte {
    background: #e9ecef;
}

.finish-preview.lustre {
    background: linear-gradient(135deg, #f8f9fa 0%, #dee2e6 50%, #f8f9fa 100%);
}

/* Upload Section */
.upload-section {
    text-align: center;
}

.upload-btn {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.upload-btn:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,123,255,0.3);
}

/* Upload Overlay */
.upload-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.upload-overlay.active {
    opacity: 1;
    visibility: visible;
}

.upload-container {
    background: white;
    border-radius: 24px;
    width: 90%;
    max-width: 640px;
    height: 80vh;
    max-height: 700px;
    min-height: 500px;
    overflow: hidden;
    position: relative;
    box-shadow: 
        0 32px 64px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    transform: scale(0.8) translateY(60px);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
}

.upload-overlay.active .upload-container {
    transform: scale(1) translateY(0);
}

/* Upload Header */
.upload-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.upload-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.upload-header-content {
    position: relative;
    z-index: 2;
}

.upload-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #333;
}

.upload-title i {
    font-size: 22px;
    opacity: 0.9;
}

/* Upload Content Area */
.upload-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 20px 30px;
}

.upload-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 0;
}

.close-upload-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 10px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 2;
}

.close-upload-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* margin-bottom: 30px; */
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}


.close-upload {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-upload:hover {
    background: #f5f5f5;
    color: #333;
}

/* Close Upload Button (for both desktop and mobile) */
.close-upload-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.close-upload-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.close-upload-btn:active {
    transform: scale(0.95);
}

.drop-zone {
    border: 3px dashed #2196f3;
    border-radius: 15px;
    padding: 40px 20px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9ff 0%, #e3f2fd 100%);
    margin-bottom: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.drop-zone:hover {
    border-color: #1976d2;
    background: linear-gradient(135deg, #f0f4ff 0%, #d1e7fd 100%);
}

.drop-zone.drag-over {
    border-color: #4caf50;
    background: linear-gradient(135deg, #f1f8e9 0%, #c8e6c9 100%);
    transform: scale(1.02);
}

.drop-icon {
    font-size: 48px;
    color: #2196f3;
    margin-bottom: 15px;
}

.drop-text {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.drop-subtext {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.browse-button {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.browse-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.4);
}

.file-input {
    display: none;
}

/* Image Grid with Fixed Aspect Ratios */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 320px));
    gap: 20px;
    margin-top: 15px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    /* Ensure grid fills available space when visible */
    max-width: 100%;
    justify-content: center;
    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.image-grid::-webkit-scrollbar {
    width: 6px;
}

.image-grid::-webkit-scrollbar-track {
    background: transparent;
}

.image-grid::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}

.image-grid::-webkit-scrollbar-thumb:hover {
    background-color: #999;
}

.image-grid:empty {
    display: none;
}

/* When only grid is visible (upload area hidden) */
.upload-container .image-grid[style*="display: grid"] {
    border-radius: 0 0 12px 12px;
    margin-top: 0;
}

/* When upload area is hidden, give more space to grid */
.upload-container:has(.upload-area[style*="display: none"]) .image-grid,
.upload-container .upload-area[style*="display: none"] ~ .image-grid {
    margin-top: 10px;
}

/* Grid header when inside upload container */
.upload-container .grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px 15px 15px;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 0;
    background: white;
    border-radius: 12px 12px 0 0;
}

.upload-container .grid-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.upload-container .grid-stats {
    display: flex;
    gap: 10px;
    align-items: center;
}

.upload-container .grid-count {
    background: #007bff;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Warning state when approaching limit (80-95%) */
.upload-container .grid-count.warning {
    background: #ff9500;
}

/* Danger state when near limit (95%+) */
.upload-container .grid-count.danger {
    background: #dc3545;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.upload-container .grid-quantity {
    background: #28a745;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.image-item {
    position: relative;
    border-radius: 12px;
    /*overflow: hidden;*/
    background: white;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.image-item:hover {
    border-color: #2196f3;
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.3);
}

.image-item.selected {
    border-color: #2196f3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.2);
}

/* Row 1: Header */
.image-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.image-item-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 8px;
}

.delete-btn-small {
    width: 24px;
    height: 24px;
    border: none;
    background: #dc3545;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: all 0.2s ease;
}

.delete-btn-small:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Row 2: Image Container */
.image-container {
    flex: 1;
    aspect-ratio: 3/2;
    overflow: hidden;
    background: #f8f9fa;
    cursor: pointer;
    border: 3px solid #007bff;
    border-radius: 6px;
    margin: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.image-container img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
    border-radius: 2px;
}

.image-item:hover .image-container img {
    transform: scale(1.05);
}

/* Row 3: Footer */
.image-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #ffffff;
    border-top: 1px solid #e9ecef;
    min-height: 60px;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.edit-btn-small {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,123,255,0.2);
}

.edit-btn-small:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

.crop-info-small {
    font-size: 13px;
    color: #555;
    font-weight: 500;
    white-space: nowrap;
    background: #e8f4f8;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #b3d9e6;
}

.quantity-controls-small {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 8px 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.quantity-btn-small {
    width: 30px;
    height: 30px;
    border: none;
    background: white;
    color: #666;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.quantity-btn-small:hover:not(:disabled) {
    background: #007bff;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(0,123,255,0.3);
}

.quantity-btn-small:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.quantity-display-small {
    color: #333;
    font-weight: 700;
    font-size: 16px;
    min-width: 28px;
    text-align: center;
    padding: 0 8px;
}

.upload-progress {
    margin-top: 20px;
    display: none;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 14px;
    color: #666;
    text-align: center;
}

.upload-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.cancel-upload,
.confirm-upload {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-upload {
    background: #f5f5f5;
    color: #666;
}

.cancel-upload:hover {
    background: #e0e0e0;
    color: #333;
}

.confirm-upload {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.confirm-upload:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

.confirm-upload:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .upload-container {
        width: 96%;
        padding: 0;
        margin: 2vh 2%;
        height: 96vh;
        max-height: 96vh;
        min-height: 400px;
    }
    
    .upload-header {
        padding: 12px 16px;
        margin-bottom: 0;
    }
    
    .upload-title {
        font-size: 18px;
    }
    
    .upload-title i {
        font-size: 20px;
    }
    
    .close-upload-btn {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
    
    .upload-content {
        padding: 16px 20px;
    }
    
    .upload-zone {
        padding: 30px 20px;
        max-width: none;
    }
    
    .upload-icon {
        font-size: 40px;
        margin-bottom: 15px;
    }
    
    .upload-area h3 {
        font-size: 18px;
    }
    
    .upload-area p {
        font-size: 14px;
    }
    
    .browse-btn {
        padding: 12px 24px;
        font-size: 14px;
    }
    
    .upload-info {
        margin-top: 16px;
        padding-top: 12px;
    }
    
    .upload-info small {
        font-size: 12px;
    }
    
    .upload-progress {
        margin-top: 20px;
        padding: 20px;
    }
    
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 280px));
        gap: 16px;
        padding: 12px 16px;
        border-radius: 8px;
        justify-content: center;
    }
    
    /* Mobile grid header adjustments */
    .upload-container .grid-header {
        padding: 10px 15px;
        border-radius: 8px 8px 0 0;
    }
    
    .upload-container .grid-title {
        font-size: 16px;
    }
    
    .upload-actions {
        flex-direction: column;
    }
    
    .cancel-upload,
    .confirm-upload {
        width: 100%;
    }
}

/* Image Grid Modal (Separate) */
.image-grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.image-grid-overlay.active {
    opacity: 1;
    visibility: visible;
}

.image-grid-container {
    background: white;
    border-radius: 20px;
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    max-height: 800px;
    overflow: hidden;
    position: relative;
    box-shadow: 
        0 32px 64px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    transform: scale(0.8) translateY(60px);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
}

.image-grid-overlay.active .image-grid-container {
    transform: scale(1) translateY(0);
}

/* Grid Modal Header */
.grid-modal-header {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.grid-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.grid-header-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 15px;
}

.grid-modal-header .grid-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.grid-modal-header .grid-title i {
    font-size: 22px;
    opacity: 0.9;
}

.grid-modal-header .grid-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

/* Modal warning states */
.grid-modal-header .grid-count.warning {
    background: rgba(255, 149, 0, 0.9);
}

.grid-modal-header .grid-count.danger {
    background: rgba(220, 53, 69, 0.9);
    animation: pulse 2s infinite;
}

.close-grid-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 10px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 2;
}

.close-grid-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Grid Content */
.grid-content {
    flex: 1;
    overflow: hidden;
    padding: 20px;
    background: #f8f9fa;
}

.grid-content .image-grid {
    display: grid;
    height: 100%;
    overflow-y: auto;
    padding: 0;
    background: transparent;
    border-radius: 0;
    margin-top: 0;
    grid-template-columns: repeat(auto-fill, minmax(280px, 320px));
    gap: 20px;
    justify-content: center;
}

/* Mobile responsive for Image Grid Modal */
@media (max-width: 768px) {
    .image-grid-container {
        width: 98%;
        height: 95vh;
        border-radius: 16px;
    }
    
    .grid-modal-header {
        padding: 12px 16px;
    }
    
    .grid-modal-header .grid-title {
        font-size: 18px;
    }
    
    .grid-modal-header .grid-title i {
        font-size: 20px;
    }
    
    .grid-modal-header .grid-count {
        font-size: 13px;
        padding: 3px 10px;
    }
    
    .close-grid-btn {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
    
    .grid-content {
        padding: 16px;
    }
    
    .grid-content .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 280px));
        gap: 16px;
    }
}

/* Modal Header */
.modal-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
}

.pricing-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.total-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #007bff;
}

.photo-count {
    color: #6c757d;
}

.close-btn {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #5a6268;
}

/* Upload Area */
.upload-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    background: #fafbfc;
    /* overflow-y: auto; */
}

.upload-zone {
    border: 3px dashed #dee2e6;
    border-radius: 16px;
    /* padding: 40px 30px; */
    text-align: center;
    background: white;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    max-width: 500px;
    width: 100%;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.upload-zone::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.4s ease;
    pointer-events: none;
}

.upload-zone:hover::before {
    transform: translate(-50%, -50%) scale(1);
}

.upload-zone:hover {
    border-color: #667eea;
    background: white;
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.15);
}

.upload-zone.drag-over {
    border-color: #28a745;
    background: #f8fff9;
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 25px 50px rgba(40, 167, 69, 0.2);
}

.upload-zone-content {
    position: relative;
    z-index: 2;
}

.upload-icon {
    font-size: 48px;
    color: #667eea;
    margin-bottom: 18px;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.upload-zone:hover .upload-icon {
    color: #5a67d8;
    transform: scale(1.1);
}

.upload-area h3 {
    font-size: 22px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
    line-height: 1.2;
}

.upload-area p {
    font-size: 16px;
    color: #718096;
    margin-bottom: 24px;
    font-weight: 400;
}

.browse-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0px 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.browse-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.browse-btn:hover::before {
    left: 100%;
}

.browse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(102, 126, 234, 0.4);
}

.browse-btn:active {
    transform: translateY(0);
}

.upload-info {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.upload-info small {
    color: #a0aec0;
    font-size: 13px;
    font-weight: 500;
}

/* Upload Progress */
.upload-progress {
    margin-top: 30px;
    background: white;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    max-width: 450px;
    width: 100%;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.progress-header h4 {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    width: 0%;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 20px 20px;
    animation: progress-stripes 1s linear infinite;
}

@keyframes progress-stripes {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 20px 0;
    }
}

.progress-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-text {
    font-size: 14px;
    color: #718096;
    font-weight: 500;
}

.progress-percentage {
    font-size: 16px;
    font-weight: 700;
    color: #667eea;
}

/* Image Grid Modal (Fullscreen) */
.image-grid-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: white;
    z-index: 1000;
    display: none;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.image-grid-modal.active {
    display: flex;
    transform: translateY(0);
}

/* Modal Header */
.modal-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
}

.pricing-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.total-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #007bff;
}

.photo-count {
    color: #6c757d;
}

.close-btn {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #5a6268;
}

/* Upload Area */
.upload-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 30px;
}

.upload-zone {
    border: 3px dashed #007bff;
    border-radius: 12px;
    padding: 20px 40px;
    text-align: center;
    background: #f8f9ff;
    cursor: pointer;
    transition: all 0.3s ease;
    max-width: 500px;
    width: 100%;
}

.upload-zone:hover {
    border-color: #0056b3;
    background: #f0f8ff;
}

.upload-zone.drag-over {
    border-color: #28a745;
    background: #f0fff4;
}

.upload-zone i {
    font-size: 3rem;
    color: #007bff;
    margin-bottom: 20px;
    display: block;
}

.upload-zone h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.upload-zone p {
    color: #6c757d;
    margin-bottom: 20px;
}

.select-files-btn {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select-files-btn:hover {
    background: #0056b3;
}

/* Image Grid - Professional Cards */
.image-grid {
    display: none;
    padding: 30px;
    flex: 1;
    overflow-y: auto;
    background: #f8f9fa;
}

.image-grid.active {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* Professional Image Card */
.image-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
}

.image-card.fade-in {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.image-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #007bff;
}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px 12px;
    background: white;
    border-bottom: 1px solid #f0f2f5;
}

.filename {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.card-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.image-card:hover .card-actions {
    opacity: 1;
}

.card-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: #f8f9fa;
    color: #6c757d;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
}

.card-action-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.card-action-btn.remove-btn:hover {
    background: #fee;
    color: #dc3545;
}

/* Quality Badge */
.quality-badge {
    position: absolute;
    top: 60px;
    left: 20px;
    z-index: 10;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    backdrop-filter: blur(4px);
}

.quality-badge.high {
    background: rgba(40, 167, 69, 0.9);
}

.quality-badge.medium {
    background: rgba(255, 193, 7, 0.9);
}

.quality-badge.low {
    background: rgba(220, 53, 69, 0.9);
}

/* Image Container */
.image-container {
    position: relative;
    padding: 20px;
    background: #f8f9fa;
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-frame {
    position: relative;
    background: white;
    padding: 8px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 100%;
    max-height: 200px;
}

.image-frame img {
    display: block;
    max-width: 100%;
    max-height: 184px;
    object-fit: contain;
    border-radius: 2px;
}

/* Crop Overlay */
.crop-overlay {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 2px solid #007bff;
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.image-card:hover .crop-overlay {
    opacity: 1;
}

/* Card Footer */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #f0f2f5;
}

.crop-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.crop-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: white;
    color: #6c757d;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 16px;
}

.crop-btn:hover {
    background: #f8f9fa;
    border-color: #007bff;
    color: #007bff;
}

.crop-label {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

/* Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: white;
    color: #6c757d;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
}

.quantity-btn:hover {
    background: #f8f9fa;
    color: #007bff;
}

.quantity-input {
    width: 50px;
    height: 36px;
    border: none;
    border-left: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    background: white;
    outline: none;
}

/* Bottom Actions */
.bottom-actions {
    background: white;
    border-top: 1px solid #e9ecef;
    padding: 20px 30px;
    display: none;
    justify-content: space-between;
    align-items: center;
}

.bottom-actions.active {
    display: flex;
}

.left-actions {
    display: flex;
    gap: 15px;
}

.action-btn {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px 20px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.primary-btn {
    background: #007bff;
    color: white;
    border: 1px solid #007bff;
    border-radius: 6px;
    padding: 12px 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-btn:hover {
    background: #0056b3;
    border-color: #004085;
}

/* Fixed Bottom Bar */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e0e0e0;
    padding: 15px 20px;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.bottom-bar-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
}

/* Add Image Button */
.add-image-btn {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    min-height: 48px;
}

.add-image-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

/* Image Controls */
.image-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.control-btn {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    min-height: 40px;
}

.control-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

/* Image Counter */
.image-counter {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
}

#imageCountText {
    color: #007bff;
}

/* Image Editor Modal */
.image-editor-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #2d2d2d;
    z-index: 1001;
    display: none;
    flex-direction: column;
}

.image-editor-modal.active {
    display: flex;
}

.editor-header {
    background: white;
    color: #333;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e8e9ea;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.editor-title-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.editor-counter {
    background: #f8f9fa;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 13px;
    color: #6c757d;
    border: 1px solid #e8e9ea;
    font-weight: 500;
}

.editor-quality-badge {
    background: #4CAF50;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.editor-actions {
    display: flex;
    gap: 10px;
}

.editor-btn {
    background: white;
    color: #6c757d;
    border: 1px solid #e8e9ea;
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
}

.editor-btn:hover {
    background: #f8f9fa;
    border-color: #ced4da;
    color: #495057;
}

.save-btn {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

.save-btn:hover {
    background: #0056b3;
    border-color: #0056b3;
}

.reset-btn {
    background: #6c757d;
    border-color: #6c757d;
    color: white;
}

.reset-btn:hover {
    background: #545b62;
    border-color: #4e555b;
}

.reset-all-btn {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

.reset-all-btn:hover {
    background: #c82333;
    border-color: #bd2130;
}

/* Editor Content Layout */
.editor-content {
    flex: 1;
    display: flex;
    overflow: hidden;
    background: #f8f9fa;
}

/* Left Panel - Canvas Area with Soft Background */
.canvas-area {
    flex: 1;
    background: #f5f6f7;
    background-image: 
        radial-gradient(circle, rgba(0,0,0,0.02) 1px, transparent 1px);
    background-size: 30px 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 60px 40px 40px; /* Sağdan daha fazla boşluk */
    position: relative;
}

/* Paper Frame for Print Preview */
.paper-frame {
    background: white;
    border-radius: 0px;
    padding: 0px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.1);
    position: relative;
    max-width: 98%; /* Increased from 90% */
    max-height: 98%; /* Increased from 90% */
}

.paper-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 0px solid #e0e0e0;
    border-radius: 0px;
    pointer-events: none;
}

/* Canvas Element */
#editorCanvas {
    display: block;
    /* border-radius: 4px; */ 
    max-width: none; /* Remove size restrictions */
    max-height: none; /* Remove size restrictions */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Right Panel - Control Panel */
.editor-tools {
    width: 380px; /* 320px'den 380px'e genişletildi */
    background: #fdfdfd;
    border-left: 1px solid #e8e9ea;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Scroll için gerekli */
}

/* Tool Tabs */
.tool-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e8e9ea;
    padding: 4px;
    gap: 2px;
    flex-shrink: 0; /* Tab alanının sabit kalması için */
}

.tool-tab {
    flex: 1;
    background: transparent;
    color: #6c757d;
    border: none;
    padding: 12px 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
}

.tool-tab:hover {
    background: rgba(255,255,255,0.7);
    color: #495057;
}

.tool-tab.active {
    background: white;
    color: #007bff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tab-icon {
    font-size: 18px;
}

/* Tool Content */
.tool-content {
    flex: 1;
    overflow-y: auto; /* Scroll aktif */
    overflow-x: hidden; /* Yatay scroll gizli */
    background: #f8f9fa;
    padding: 8px;
    height: 0; /* Flexbox ile düzgün scroll için */
    min-height: 0; /* Flexbox ile düzgün scroll için */
}

/* Tool Panels */
.tool-panel {
    padding: 16px;
    background: white;
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #e8e9ea;
}

.tool-panel h4 {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
}

/* Info Panel */
.info-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.info-label {
    color: #666;
}

.info-value {
    font-weight: 500;
    color: #333;
}

/* Transform Grid */
.transform-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.transform-btn {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666;
}

.transform-btn:hover {
    background: #e9ecef;
    color: #007bff;
    border-color: #007bff;
}

.transform-btn i {
    font-size: 16px;
}

/* Crop Controls */
.crop-ratios {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 15px 0;
}

.crop-ratio-btn {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    color: #666;
    text-align: center;
}

.crop-ratio-btn:hover,
.crop-ratio-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Border Controls */
.border-options {
    display: flex;
    gap: 15px;
    margin: 15px 0;
}

.border-option {
    flex: 1;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 13px;
    color: #666;
}

.border-option:hover,
.border-option.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Border Controls Enhanced */
.border-width-control {
    margin: 20px 0;
}

.border-width-control label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.border-width-slider {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.border-width-slider input[type="range"] {
    flex: 1;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.border-width-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #007bff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,123,255,0.3);
}

.border-width-slider input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #007bff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0,123,255,0.3);
}

.border-width-value {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 600;
    color: #007bff;
    min-width: 50px;
    text-align: center;
}

.border-quick-options {
    margin: 20px 0;
}

.border-quick-options h5 {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.border-quick-options .border-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 0;
}

.border-quick-options .border-option {
    font-size: 12px;
    padding: 8px;
    margin: 0;
}

.border-preview-container {
    margin: 20px 0;
}

.border-preview-container h5 {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.border-preview {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.border-preview-image {
    width: 80px;
    height: 100px;
    background: #007bff;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.border-preview-content {
    width: 100%;
    height: 100%;
    background: #007bff;
    border-radius: 2px;
}

.border-actions {
    margin: 25px 0 0;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.tool-btn {
    width: 100%;
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tool-btn:hover:not(:disabled) {
    background: #e9ecef;
    border-color: #adb5bd;
}

.tool-btn.primary {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.tool-btn.primary:hover:not(:disabled) {
    background: #0056b3;
    border-color: #0056b3;
}

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

.tool-description {
    font-size: 13px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.4;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .editor-header {
        padding: 10px 15px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .editor-title-section {
        flex: 1;
        min-width: 200px;
    }
    
    .editor-counter {
        font-size: 12px;
        padding: 3px 10px;
    }
    
    .editor-quality-badge {
        font-size: 11px;
        padding: 3px 10px;
    }
    
    .editor-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    /* Editor Content - Stack Vertically */
    .editor-content {
        flex-direction: column;
        height: calc(100vh - 60px); /* Account for header */
    }
    
    /* Canvas Area - Top Half */
    .canvas-area {
        flex: 1;
        min-height: 50vh;
        max-height: 60vh;
        padding: 15px 10px;
    }
    
    .paper-frame {
        padding: 4px;
        max-width: 100%;
        max-height: 100%;
    }
    
    /* Editor Tools - Bottom Half */
    .editor-tools {
        width: 100%;
        height: auto;
        max-height: 40vh;
        border-left: none;
        border-top: 1px solid #e8e9ea;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    /* Tool Tabs - Horizontal Scroll */
    .tool-tabs {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 4px;
        background: #f8f9fa;
        border-bottom: 1px solid #e8e9ea;
        -webkit-overflow-scrolling: touch;
        flex-shrink: 0;
    }
    
    .tool-tab {
        flex: 0 0 auto;
        min-width: 80px;
        padding: 12px 8px;
        font-size: 10px;
    }
    
    .tab-icon {
        font-size: 16px;
    }
    
    /* Tool Content - Scrollable */
    .tool-content {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        height: 0;
        min-height: 0;
        -webkit-overflow-scrolling: touch;
        padding: 6px;
    }
    
    /* Tool Panels - Compact */
    .tool-panel {
        padding: 15px;
    }
    
    .tool-panel h4 {
        font-size: 12px;
        margin-bottom: 12px;
    }
    
    /* Transform Grid - Smaller */
    .transform-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .transform-btn {
        padding: 8px;
        font-size: 11px;
    }
    
    .transform-btn i {
        font-size: 14px;
    }
    
    /* Navigation Controls - Stack */
    .navigation-controls {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    .nav-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Mobile Upload Area */
@media (max-width: 768px) {
    /* Upload Overlay - Full Screen */
    .upload-overlay {
        padding: 0;
    }
    
    .upload-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        max-width: 100vw;
        max-height: 100vh;
    }
    
    /* Close Button - Mobile Friendly */
    .close-upload-btn {
        top: 10px;
        right: 10px;
        width: 44px;
        height: 44px;
        font-size: 18px;
        background: rgba(0,0,0,0.8);
        color: white;
    }
    
    /* Upload Area - Mobile Optimized */
    .upload-area {
        padding: 30px 20px;
        margin: 15px;
        height: calc(100vh - 60px);
    }
    
    .upload-icon {
        font-size: 48px;
        margin-bottom: 20px;
    }
    
    .upload-area h3 {
        font-size: 24px;
        margin-bottom: 10px;
    }
    
    .upload-area p {
        font-size: 16px;
        margin-bottom: 30px;
    }
    
    .browse-btn {
        padding: 15px 30px;
        font-size: 16px;
        border-radius: 8px;
    }
    
    /* Grid Header - Mobile */
    .grid-header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .grid-title {
        font-size: 20px;
    }
    
    .grid-count {
        padding: 6px 14px;
        font-size: 14px;
    }
    
    /* Image Grid - Mobile Layout */
    .image-grid {
        padding: 15px;
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
        max-height: calc(100vh - 120px);
    }
    
    .image-item {
        border-radius: 12px;
    }
    
    .image-item img {
        height: 100px;
    }
    
    .image-item-info {
        padding: 6px;
        opacity: 1; /* Always visible on mobile */
    }
    
    .image-item-name {
        font-size: 11px;
        margin-bottom: 2px;
    }
    
    .image-quantity-controls {
        font-size: 10px;
        gap: 4px;
    }
    
    .quantity-btn-small {
        width: 18px;
        height: 18px;
        font-size: 9px;
    }
    
    .quantity-display-small {
        font-size: 11px;
        min-width: 14px;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    /* Editor Header - Very Compact */
    .editor-header {
        padding: 8px 10px;
    }
    
    .editor-title-section {
        flex-direction: column;
        gap: 5px;
    }
    
    .editor-actions {
        flex-direction: column;
        gap: 5px;
    }
    
    .editor-btn {
        padding: 8px 12px;
        font-size: 12px;
        min-width: 80px;
    }
    
    /* Canvas Area - Optimized */
    .canvas-area {
        min-height: 45vh;
        max-height: 50vh;
        padding: 5px;
    }
    
    .paper-frame {
        padding: 0px;
    }
    
    /* Tool Tabs - Smaller */
    .tool-tab {
        min-width: 70px;
        padding: 10px 6px;
        font-size: 9px;
    }
    
    .tab-icon {
        font-size: 14px;
    }
    
    /* Upload Area - Compact */
    .upload-area {
        padding: 20px 15px;
        margin: 10px;
    }
    
    .upload-icon {
        font-size: 40px;
        margin-bottom: 15px;
    }
    
    .upload-area h3 {
        font-size: 20px;
        margin-bottom: 8px;
    }
    
    .upload-area p {
        font-size: 14px;
        margin-bottom: 25px;
    }
    
    .browse-btn {
        padding: 12px 24px;
        font-size: 14px;
    }
    
    /* Image Grid - Very Compact */
    .image-grid {
        padding: 10px;
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .image-item img {
        height: 80px;
    }
    
    .image-item-info {
        padding: 6px;
    }
    
    .image-item-name {
        font-size: 11px;
    }
    
    /* Grid Header - Compact */
    .grid-header {
        padding: 12px 15px;
    }
    
    .grid-title {
        font-size: 18px;
    }
    
    .close-upload-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* Bottom Bar - Mobile */
@media (max-width: 768px) {
    .bottom-bar {
        padding: 12px 15px;
    }
    
    .bottom-bar-content {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .add-image-btn {
        width: 100%;
        justify-content: center;
        padding: 16px;
        font-size: 16px;
    }
    
    .image-controls {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .control-btn {
        width: 100%;
        justify-content: center;
        padding: 14px;
        font-size: 14px;
    }
    
    .image-counter {
        text-align: center;
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* Landscape Mobile Orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .editor-content {
        flex-direction: row;
    }
    
    .canvas-area {
        flex: 2;
        min-height: auto;
        max-height: none;
    }
    
    .editor-tools {
        width: 300px;
        height: auto;
        max-height: none;
        border-left: 1px solid #e0e0e0;
        border-top: none;
    }
    
    .tool-tabs {
        flex-direction: column;
        overflow: visible;
    }
    
    .tool-tab {
        min-width: auto;
        width: 100%;
    }
}

/* Touch Improvements */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .tool-tab {
        min-height: 48px;
    }
    
    .transform-btn {
        min-height: 44px;
    }
    
    .nav-btn {
        min-height: 44px;
    }
    
    .control-btn {
        min-height: 48px;
    }
    
    .image-item {
        cursor: default;
    }
    
    /* Remove hover effects on touch devices */
    .image-item:hover {
        transform: none;
        border-color: #e0e0e0;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    .transform-btn:hover {
        background: #f8f9fa;
        color: #666;
        border-color: #e0e0e0;
    }
}

/* Paper Size Info in Editor */
.paper-size-info {
    margin: 15px 0;
}

.current-paper-size {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
}

.paper-preview-small {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 6px;
    padding: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.paper-ratio-small {
    background: #2196f3;
    border: 1px solid #1976d2;
    border-radius: 2px;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}

.paper-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.paper-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.paper-dimensions {
    font-size: 12px;
    color: #666;
}

/* Paper Size Selector in Editor */
.paper-size-selector {
    margin: 15px 0;
}

.paper-size-dropdown {
    width: 100%;
    padding: 12px 16px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 12px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.paper-size-dropdown:hover {
    border-color: #2196f3;
    background-color: #f8f9fa;
}

.paper-size-dropdown:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.current-paper-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
}

/* Crop Info Box and Controls */
.crop-info-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 13px;
    color: #1565c0;
}

.crop-info-box i {
    color: #2196f3;
    font-size: 14px;
}

.crop-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
}

/* Enhanced dropdown styles */
.paper-size-dropdown option {
    padding: 8px 12px;
    font-size: 14px;
}

/* Filter Styles */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 15px;
}

.filter-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    font-size: 12px;
    text-align: center;
}

.filter-btn:hover {
    border-color: #007bff;
    background: #f8f9fa;
    transform: translateY(-1px);
}

.filter-btn.active {
    border-color: #007bff;
    background: #e3f2fd;
    color: #007bff;
    font-weight: 600;
}

.filter-preview {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    position: relative;
    overflow: hidden;
}

/* Filter preview effects */
.filter-preview.original {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
}

.filter-preview.bw {
    background: linear-gradient(45deg, #666, #999, #ccc, #eee);
}

.filter-preview.sepia {
    background: linear-gradient(45deg, #8b4513, #cd853f, #daa520, #f4a460);
}

.filter-preview.vintage {
    background: linear-gradient(45deg, #d2691e, #daa520, #cd853f, #f5deb3);
}

.filter-preview.bright {
    background: linear-gradient(45deg, #ffeb3b, #ffc107, #ff9800, #ff5722);
    box-shadow: 0 0 10px rgba(255, 235, 59, 0.5);
}

.filter-preview.contrast {
    background: linear-gradient(45deg, #000, #fff, #000, #fff);
}

.filter-preview.cool {
    background: linear-gradient(45deg, #2196f3, #03a9f4, #00bcd4, #009688);
}

.filter-preview.warm {
    background: linear-gradient(45deg, #ff5722, #ff9800, #ffc107, #ffeb3b);
}

/* Filter intensity control */
.intensity-control {
    margin-top: 15px;
}

.intensity-control label {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.intensity-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.intensity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.intensity-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Batch filter controls */
.batch-filter-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.batch-filter-controls .transform-btn {
    width: 100%;
}

.batch-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #666;
    margin-top: 10px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.batch-info i {
    color: #007bff;
    font-size: 14px;
}

.filter-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
    margin-bottom: 15px;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #007bff;
}

.filter-info i {
    color: #007bff;
    font-size: 14px;
}

/* Mobile filter adjustments */
@media (max-width: 768px) {
    .filter-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .filter-btn {
        padding: 8px 4px;
        font-size: 11px;
    }
    
    .filter-preview {
        width: 32px;
        height: 32px;
    }
    
    .batch-filter-controls {
        gap: 8px;
    }
}

/* Enhanced Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.quantity-input-group {
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.quantity-input-group:hover {
    border-color: #007bff;
    box-shadow: 0 4px 8px rgba(0,123,255,0.15);
}

.quantity-input-group:focus-within {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

/* Apply to All Section */
.apply-to-all-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e8e9ea;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.apply-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6c757d;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #007bff;
}

.apply-info i {
    color: #007bff;
    font-size: 14px;
}

.quantity-btn {
    background: #f8f9fa;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
    font-size: 16px;
    font-weight: bold;
}

.quantity-btn:hover {
    background: #007bff;
    color: white;
    transform: scale(1.05);
}

.quantity-btn:active {
    transform: scale(0.95);
}

.quantity-btn:disabled {
    background: #f0f0f0;
    color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.quantity-input {
    border: none;
    background: transparent;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    width: 60px;
    height: 40px;
    outline: none;
    appearance: textfield;
    -moz-appearance: textfield;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.delete-btn {
    background: linear-gradient(135deg, #ff4757, #ff3742);
    border: none;
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(255,71,87,0.3);
}

.delete-btn:hover {
    background: linear-gradient(135deg, #ff3742, #ff2731);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,71,87,0.4);
}

.delete-btn:active {
    transform: translateY(0);
}

/* Enhanced Navigation Controls */
.navigation-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    gap: 12px;
}

.nav-btn {
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    font-size: 14px;
    font-weight: 500;
    min-width: 100px;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,123,255,0.3);
    flex: 1;
}

.nav-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.4);
}

.nav-btn:active:not(:disabled) {
    transform: translateY(0);
}

.nav-btn:disabled {
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
    color: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.nav-btn i {
    font-size: 14px;
}

.grid-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    border: none;
    border-radius: 12px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(40,167,69,0.3);
    flex-shrink: 0;
}

.grid-btn:hover {
    background: linear-gradient(135deg, #20c997, #17a2b8);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(40,167,69,0.4);
}

.grid-btn:active {
    transform: translateY(0) scale(1);
}

/* Quantity Display Enhancement */
.quantity-display {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.quantity-label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.quantity-value {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,123,255,0.2);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .quantity-controls {
        flex-direction: column;
        gap: 16px;
    }
    
    .quantity-input-group {
        align-self: stretch;
    }
    
    .delete-btn {
        align-self: center;
        width: 48px;
        height: 48px;
    }
    
    .navigation-controls {
        flex-direction: column;
        gap: 12px;
    }
    
    .nav-btn {
        min-width: auto;
        padding: 14px 20px;
    }
    
    .grid-btn {
        order: -1;
        width: 56px;
        height: 56px;
        font-size: 20px;
    }
}

/* Save All Button Styling */
.save-all-btn {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    border-color: #28a745 !important;
}

.save-all-btn:hover {
    background: linear-gradient(135deg, #218838, #1ea085) !important;
    border-color: #1e7e34 !important;
    transform: translateY(-1px);
}

.save-all-btn:active {
    transform: translateY(0);
}

.save-all-btn i {
    margin-right: 6px;
}