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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    padding: 10px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    overflow-x: hidden;
}

@media (min-width: 768px) {
    body {
        padding: 20px;
    }
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5em;
}

@media (min-width: 768px) {
    h1 {
        font-size: 2.5em;
        margin-bottom: 30px;
    }
}

.controls {
    background: #fdfdfd;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid #eee;
    margin-bottom: 10px;
}

@media (min-width: 768px) {
    .controls {
        padding: 12px;
        margin-bottom: 15px;
    }
}

.input-section {
    margin-bottom: 10px;
}

.input-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.input-section input,
.input-section select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.input-section input:focus,
.input-section select:focus {
    outline: none;
    border-color: #667eea;
}

/* Bottle inputs and rows will be handled by the new styles added below */

.drag-bottle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 55px; /* Sabit genişlik, squashing engeller */
    margin: 0 2px;
}

.drag-bottle-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 10px;
    white-space: nowrap;
}

.drag-bottle {
    width: 100%; /* Konteyner genişliğine uyarla */
    aspect-ratio: 1 / 2.5; /* Orantılı boy */
    max-width: 70px;
    height: auto; /* Aspect ratio ile çalışması için */
    min-height: 120px;
    border: 2px solid #333;
    border-radius: 0 0 10px 10px;
    border-top: none;
    position: relative;
    background: rgba(255, 255, 255, 0.9);
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.drag-bottle-top {
    width: 70%;
    height: 12px;
    border: 2px solid #333;
    border-bottom: none;
    border-radius: 5px 5px 0 0;
    margin: 0 auto 0;
    background: rgba(255, 255, 255, 0.8);
}

@media (min-width: 768px) {
    .input-bottle-row {
        justify-content: center; /* Geniş ekranda ortala */
        flex-wrap: wrap; /* Geniş ekranda sığmazsa alt satıra geçsin */
        gap: 12px;
        padding: 15px;
    }

    .drag-bottle-container {
        flex: 0 0 80px; /* Desktop'ta daha geniş */
        margin: 5px;
    }

    .drag-bottle-label {
        margin-bottom: 10px;
        font-size: 14px;
    }

    .drag-bottle {
        width: 80px;
        height: 200px;
        border: 4px solid #333;
        border-radius: 0 0 15px 15px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    }

    .drag-bottle-top {
        width: 60px;
        height: 20px;
        border: 4px solid #333;
        border-radius: 8px 8px 0 0;
    }
}

.drag-slot {
    width: 100%;
    height: 25%; /* 4 slot olduğu için her biri %25 */
    border-bottom: 1px dashed #ccc;
    position: relative;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: pan-x; /* Yatay scroll'a izin ver */
    cursor: pointer;
}

.drag-slot:hover {
    background: rgba(44, 62, 80, 0.05);
}

.drag-slot.drag-over {
    background: rgba(102, 126, 234, 0.2);
    border-bottom: 2px solid #667eea;
}

.drag-slot.filled {
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.color-chip {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: move;
}

.color-chip .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-chip:hover .remove-btn {
    opacity: 1;
}

.main-workspace {
    display: flex;
    gap: 10px;
    margin-top: 5px;
    align-items: flex-start;
    width: 100%;
    min-width: 0;
}

.color-palette-section {
    flex-shrink: 0;
    width: 300px;
    padding: 12px;
    background: #fdfdfd;
    border-radius: 10px;
    position: sticky;
    top: 5px;
    border: 1px solid #eee;
    min-width: 0;
}

.bottles-workspace {
    flex: 1;
    padding: 10px;
    background: #f5f7f9;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    border: 1px solid #eee;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.color-counter {
    margin-top: 15px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    border: 2px solid #e0e0e0;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .color-counter {
        margin-top: 20px;
        padding: 15px;
        border-radius: 8px;
    }
}

#colorCountList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 5px;
    font-size: 10px;
    width: 100%;
}

.color-count-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    background: #f8f9fa;
    border-radius: 5px;
    font-weight: 600;
}

.color-count-badge {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid #333;
    flex-shrink: 0;
}

.color-count-text {
    flex: 1;
    color: #495057;
}

.color-count-number {
    color: #2c3e50;
    font-weight: bold;
    font-size: 14px;
}

.color-count-warning {
    color: #ff6b6b;
}

.color-count-success {
    color: #51cf66;
}

@media (max-width: 1024px) {
    .main-workspace {
        flex-direction: column;
    }

    .color-palette-section {
        width: 100%;
        position: static;
    }
}

.buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

button {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    flex: 1;
    min-width: 120px;
}

@media (min-width: 768px) {
    .buttons {
        gap: 15px;
        margin-top: 20px;
    }

    button {
        padding: 12px 30px;
        font-size: 16px;
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
        flex: initial;
        min-width: auto;
    }
}

.btn-primary {
    background: #2c3e50;
    color: white;
}

.btn-primary:hover {
    background: #34495e;
    transform: translateY(-2px);
}

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

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
    }
    50% { 
        transform: scale(1.1);
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 1));
    }
}

.drag-bottle {
    transition: transform 0.2s ease;
}

.flying-color {
    border: 2px solid rgba(255,255,255,0.5);
}

.info-panel {
    background: white;
    padding: 20px;
    border-radius: 15px;
    border: 2px solid #667eea;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
}


.alert {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.loading {
    text-align: center;
    padding: 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading Overlay Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(3px);
}

.loading-content {
    text-align: center;
    background: white;
    padding: 40px 50px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #e0e0e0;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

.loading-text {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.loading-subtext {
    font-size: 13px;
    color: #888;
}

@keyframes pulse-bg {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 0.9; }
}

.color-palette {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.color-option {
    width: 100%;
    height: 45px;
    border-radius: 8px;
    cursor: grab;
    border: 2px solid #333;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3),
                inset 0 2px 10px rgba(255, 255, 255, 0.3);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: rgba(0, 0, 0, 0.7);
    font-size: 9px;
    text-align: center;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.9);
    padding: 3px;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

@media (min-width: 768px) {
    .color-palette {
        gap: 12px;
    }

    .color-option {
        height: 50px;
        border-radius: 10px;
        border: 3px solid #333;
        font-size: 10px;
        padding: 5px;
    }
}

.color-option:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
}

.color-option:active {
    cursor: grabbing;
}

.color-option.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.empty-option {
    background: white !important;
    border: 3px dashed #999;
    color: #666;
    font-size: 11px;
    font-weight: 800;
}

.preset-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.preset-btn {
    padding: 8px 16px;
    background: #f8f9fa;
    border: 2px solid #667eea;
    color: #667eea;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.preset-btn:hover {
    background: #667eea;
    color: white;
}

footer {
    text-align: center;
    padding: 30px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    margin-top: 40px;
}

footer a {
    display: inline-block;
    transition: opacity 0.3s;
}

footer a:hover {
    opacity: 0.7;
}

.footer-logo {
    max-width: 150px;
    height: auto;
    margin-bottom: 15px;
    cursor: pointer;
}

.footer-text {
    color: #666;
    font-size: 14px;
    margin-top: 10px;
}

/* Color Picker Modal */
.color-picker-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.color-picker-modal.active {
    display: flex;
}

.color-picker-content {
    background: white;
    border-radius: 20px;
    padding: 20px;
    max-width: 450px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 15px 50px rgba(0,0,0,0.4);
    position: relative;
}

.color-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.color-picker-header h3 {
    color: #2c3e50;
    margin: 0;
    font-size: 18px;
}

.color-picker-close {
    background: #f8f9fa;
    border: 1px solid #ddd;
    font-size: 20px;
    color: #333;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    line-height: 1;
}

.color-picker-close:hover {
    background: #fa5252;
    color: white;
    border-color: #fa5252;
}

.color-picker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 Renk yan yana */
    gap: 10px;
}

.color-picker-option {
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 2px solid #333;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-weight: bold;
    font-size: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    color: rgba(0, 0, 0, 0.7);
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.8);
}

.color-picker-option:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.color-picker-option:active {
    transform: scale(0.95);
}

/* Double Color Item Styling - Palette Style */
.double-color-item {
    width: 100%;
    height: 45px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid #333; /* İlk hali de siyah kenarlıklı */
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2); /* Hafif gölge */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: rgba(0, 0, 0, 0.7);
    font-size: 10px;
    text-align: center;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.9);
    padding: 5px;
    user-select: none;
    opacity: 0.9; /* İlk hali de canlı */
}

.double-color-item:hover {
    transform: scale(1.05);
    opacity: 1;
}

.double-color-item.active {
    opacity: 1;
    border-color: #667eea; /* Seçilince mavi çerçeve */
    border-width: 3px;
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.6),
                inset 0 2px 10px rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

/* Aktifken onay işareti */
.double-color-item.active::after {
    content: '✓';
    position: absolute;
    top: -6px;
    right: -6px;
    background: #667eea;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    z-index: 10;
}

/* Badge artık gerekmiyor çünkü arka planın kendisi o renk olacak */
.double-badge {
    display: none;
}

.double-label {
    pointer-events: none;
}

.double-label {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
}

/* Mobil Scroll İçin Şişe Alanı Düzenlemesi */
.bottle-inputs-drag {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    overflow-x: hidden; /* Dış taşıyıcıyı koru */
}

.input-bottle-row {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    flex-wrap: nowrap; /* Mobilde yan yana kalmaya zorla */
    width: 100%;
    overflow-x: auto; /* Sağa kaydırmayı aktif et */
    padding: 15px 10px 60px 10px; /* Alt boşluğu çok artır - rahat scroll için */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #667eea #f1f1f1;
}

@media (min-width: 768px) {
    .input-bottle-row {
        justify-content: center;
        flex-wrap: wrap; /* Masaüstünde sığmazsa alt satıra geçsin */
        overflow-x: hidden;
        padding-bottom: 25px; /* Masaüstünde normal padding */
    }
}

/* Mobilde şişe slotlarında yatay scroll'a izin ver */
@media (max-width: 767px) {
    .drag-slot {
        touch-action: pan-x pan-y; /* Hem yatay hem dikey scroll'a izin ver */
    }
    
    .drag-bottle {
        touch-action: pan-x; /* Şişe üzerinde de yatay scroll'a izin ver */
    }
}

/* Scroll Bar Güzelleştirme */
.input-bottle-row::-webkit-scrollbar {
    height: 8px;
}
.input-bottle-row::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
.input-bottle-row::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}
.input-bottle-row::-webkit-scrollbar-thumb:hover {
    background: #5a6fd1;
}

/* Collapsible sections */
.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 12px 15px;
    background: #f1f3f5;
    border-radius: 8px;
    margin-bottom: 10px;
    user-select: none;
    transition: all 0.3s;
    border: 1px solid #e0e0e0;
}

.collapsible-header:hover {
    background: #e9ecef;
}

.collapsible-header h2, 
.collapsible-header h3 {
    margin: 0 !important;
    font-size: 15px !important;
    color: #495057 !important;
}

.collapsible-content {
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, opacity 0.3s, margin 0.3s;
    max-height: 2000px; /* Default open */
    opacity: 1;
}

.collapsible-content.collapsed {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    pointer-events: none;
}

.toggle-icon {
    transition: transform 0.3s;
    font-size: 12px;
    color: #adb5bd;
}

.collapsed-header .toggle-icon {
    transform: rotate(-90deg);
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.8em;
    }

    footer {
        padding: 20px 15px;
        margin-top: 30px;
    }

    .footer-logo {
        max-width: 120px;
    }

    .color-picker-content {
        padding: 15px;
        max-height: 80vh;
    }

    .color-picker-grid {
        gap: 8px;
    }

    .color-picker-option {
        height: 40px;
        font-size: 9px;
    }
    
    /* Mobilde şişe satırının altına çok daha fazla boşluk ekle */
    .input-bottle-row {
        padding-bottom: 80px !important; /* Scroll için büyük boşluk */
        margin-bottom: 20px;
    }
    
    /* Şişe alanının tamamına da alt boşluk */
    .bottles-workspace {
        padding-bottom: 30px;
    }
}
 