html,
body {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #030712 0%, #0f172a 50%, #1e293b 100%);
    color: #f9fafb;
}

#preview-container {
    position: relative;
    overflow: hidden;
    transition: opacity 0.3s ease;
    width: 100%;
    max-width: clamp(360px, 55vw, 720px);
    max-height: clamp(420px, 65vh, 900px);
    margin: 0 auto;
    border-radius: 18px;
    box-shadow: none;
    background: transparent;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 3 / 4;
}

#badge-canvas {
    width: 100%;
    height: auto;
    max-height: 100%;
    aspect-ratio: 3 / 4;
    display: block;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    object-fit: contain;
    margin: 0 auto;
}

.file-input-label {
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-input-label:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
}

.slider {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, #1f2937, #374151);
    position: relative;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a5b4fc 0%, #818cf8 100%);
    cursor: pointer;
    border: 2px solid #1f2937;
    box-shadow: 0 2px 8px rgba(129, 140, 248, 0.3);
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(129, 140, 248, 0.4);
}

.slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a5b4fc 0%, #818cf8 100%);
    cursor: pointer;
    border: 2px solid #1f2937;
    box-shadow: 0 2px 8px rgba(129, 140, 248, 0.3);
    transition: all 0.2s ease;
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(129, 140, 248, 0.4);
}

.controls-panel {
    background: linear-gradient(145deg, rgba(14, 24, 44, 0.9) 0%, rgba(10, 18, 34, 0.96) 100%);
    border: none;
    padding: 0;
    box-shadow: none;
    height: 100%;
    overflow-y: auto;
    padding-right: 0.5rem;
    overscroll-behavior: contain;
    border-top-left-radius: 14px;
    border-bottom-left-radius: 14px;
}

@media (min-width: 1024px) {
    .preview-section {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        overflow: hidden;
    }
}

@media (max-width: 1023px) {
    .controls-panel {
        width: 100%;
    }

    .preview-wrapper {
        padding: 0 1rem 1rem 1rem;
    }

    body {
        overflow-y: auto;
    }
}

.preview-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0 1rem 1rem 1rem;
    height: 100%;
    width: 100%;
    margin: 0 auto;
}

.preview-section {
    height: 100%;
    min-height: 0;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(12, 21, 38, 0.9) 0%, rgba(9, 16, 30, 0.95) 100%);
    border-top-right-radius: 14px;
    border-bottom-right-radius: 14px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Responsive-block retained for potential reuse */
.responsive-block {
    width: min(100%, 420px);
    margin-left: auto;
    margin-right: auto;
}

.control-block {
    padding: 0.15rem 0;
}

.control-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: #d1d5db;
    font-size: 0.75rem;
}

.control-value {
    color: #a5b4fc;
    font-weight: 600;
    letter-spacing: 0.01em;
    font-size: 0.75rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem 0.25rem 1rem;
}

.action-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    background: linear-gradient(120deg, #111827, #0b1325);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
    transition: all 0.2s ease;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.action-chip:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.16);
}

.action-chip:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.chip-primary {
    background: linear-gradient(120deg, #ef4444, #a855f7, #3b82f6);
    color: #fff;
    border: none;
}

.chip-active {
    border: 1px solid rgba(99, 102, 241, 0.8);
    box-shadow: 0 8px 18px rgba(99, 102, 241, 0.25);
    background: linear-gradient(120deg, #101826, #0b1220);
    color: #e5e7eb;
}

.chip-icon {
    width: 16px;
    height: 16px;
}

/* Dark scrollbars for side panels and template box */
.controls-panel,
#templateContent {
    scrollbar-color: #1f2937 #0b1220;
    scrollbar-width: thin;
}

.controls-panel::-webkit-scrollbar,
#templateContent::-webkit-scrollbar {
    width: 8px;
}

.controls-panel::-webkit-scrollbar-track,
#templateContent::-webkit-scrollbar-track {
    background: transparent;
}

.controls-panel::-webkit-scrollbar-thumb,
#templateContent::-webkit-scrollbar-thumb {
    background: #1f2937;
    border-radius: 999px;
    border: 2px solid #0b1220;
}

@media (min-width: 1024px) {
    .preview-wrapper {
        align-items: center;
    }
}

@media (max-width: 768px) {
    .share-section {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .action-bar .flex {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .action-chip {
        width: 48%;
        justify-content: center;
    }
}

@media (max-width: 425px) {
    .header-text {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .header-text {
        display: none !important;
    }

    header {
        padding: 0.5rem 1rem !important;
    }

    header img {
        height: 40px !important;
    }
}

@media (max-width: 768px) {
    .controls-panel .space-y-3 > * {
        margin-top: 0.3rem !important;
        margin-bottom: 0.3rem !important;
    }

    .controls-panel {
        padding-top: 0.5rem !important;
    }
}
@media (max-width: 768px) {
    #photoInput + label {
        padding: 0.6rem !important;
        font-size: 14px !important;
    }
}
@media (max-width: 768px) {
    h3.text-lg.font-semibold.text-gray-300 {
        display: none !important;
    }
}
@media (max-width: 768px) {
    .controls-panel,
    .preview-section,
    .preview-wrapper,
    #preview-container,
    #badge-canvas,
    .action-bar,
    .responsive-block {
        border-radius: 0 !important;
    }
}


.upload-box {
    background: #111;
    padding: 1rem;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.upload-header {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.6rem;
}

.upload-icon {
    font-size: 1.1rem;
}

.upload-area {
    border: 2px dashed #3a3a3a;
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #151515;
    transition: all 0.2s ease;
    height: 100px;          
    overflow: hidden;    
}

.upload-area:hover {
    background: #1b1b1b;
    border-color: #4b4b4b;
}

.upload-arrow {
    font-size: 1.5rem;
    opacity: 0.85;
    margin-bottom: 0.3rem;
}

.upload-text {
    font-size: 0.85rem;
    opacity: 0.75;
}

.upload-box.selected .upload-area {
    border-color: #6366f1;
    background: #1a1b25;
}

.upload-box.selected .upload-header span:last-child {
    color: #818cf8;
}
.upload-preview {
    width: 100%;
    height: 160px; /* 🎯 Sabit yükseklik */
    object-fit: contain;
    background: #111;
    border-radius: 8px;
    padding: 4px;
    border: 1px solid #333;
}

.hidden {
    display: none;
}
.upload-box {
    position: relative;
}
