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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    background: #FAFAFA;
    color: #2D3748;
    line-height: 1.6;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: linear-gradient(135deg, #E8356D 0%, #FF6B9D 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(232, 53, 109, 0.3);
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-family: 'Quicksand', sans-serif;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    margin-bottom: 0.5rem;
}

.instructions {
    font-size: 1rem;
    opacity: 0.85;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    gap: 2rem;
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.grid-area {
    flex: 1;
    min-height: 500px;
}

/* Drop Zone */
.drop-zone {
    width: 100%;
    height: 100%;
    min-height: 500px;
    border: 3px dashed #E2E8F0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.drop-zone:hover {
    border-color: #E8356D;
    background: #FFF5F8;
}

.drop-zone.dragging {
    border-color: #E8356D;
    background: #FFF5F8;
    transform: scale(1.02);
}

.drop-content {
    text-align: center;
}

.berry-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.drop-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2D3748;
    margin-bottom: 0.5rem;
}

.drop-subtext {
    font-size: 1rem;
    color: #718096;
}

/* Image Grid */
.image-grid {
    display: grid;
    width: 100%;
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.image-cell {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: grab;
    transition: transform 0.2s ease;
}

.image-cell:active {
    cursor: grabbing;
}

.image-cell:hover {
    transform: scale(1.05);
    z-index: 10;
}

.grid-image {
    width: 100%;
    height: 100%;
    display: block;
}

.remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(232, 53, 109, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-cell:hover .remove-btn {
    opacity: 1;
}

.remove-btn:hover {
    background: rgba(232, 53, 109, 1);
    transform: scale(1.1);
}

/* Control Panel */
.control-panel {
    width: 320px;
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.control-section {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #2D3748;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.radio-label:hover {
    background: #F7FAFC;
}

.radio-label input[type="radio"] {
    cursor: pointer;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    background: #E2E8F0;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #E8356D;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider-value {
    font-weight: 600;
    color: #E8356D;
    min-width: 40px;
}

.color-picker-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.color-picker {
    width: 50px;
    height: 50px;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    cursor: pointer;
}

.color-value {
    font-family: monospace;
    font-size: 0.9rem;
    color: #718096;
}

.select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.select:hover,
.select:focus {
    border-color: #E8356D;
    outline: none;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 2rem;
}

.btn-primary {
    background: linear-gradient(135deg, #E8356D 0%, #FF6B9D 100%);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(232, 53, 109, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(232, 53, 109, 0.4);
}

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: #48BB78;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #38A169;
    transform: translateY(-1px);
}

.btn-tertiary {
    background: transparent;
    color: #718096;
    border: 2px solid #E2E8F0;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-tertiary:hover {
    border-color: #E8356D;
    color: #E8356D;
}

/* Footer */
.footer {
    background: white;
    padding: 1.5rem;
    text-align: center;
    border-top: 1px solid #E2E8F0;
    margin-top: auto;
}

.berry-fact {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 0.5rem;
    font-style: italic;
}

.credit {
    font-size: 0.85rem;
    color: #A0AEC0;
}

.credit a {
    color: #E8356D;
    text-decoration: none;
    font-weight: 600;
}

.credit a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }

    .control-panel {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .instructions {
        font-size: 0.9rem;
    }

    .main-content {
        padding: 1rem;
    }

    .grid-area {
        min-height: 400px;
    }

    .drop-zone {
        min-height: 400px;
    }

    .berry-icon {
        font-size: 3rem;
    }

    .drop-text {
        font-size: 1.2rem;
    }
}