/* ===========================
   RESET & BASE STYLES
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* ===========================
   HEADER
   =========================== */
.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 1.5rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.header h1 {
    font-size: 2rem;
    color: #764ba2;
    margin-bottom: 0.25rem;
}

.header p {
    color: #666;
    font-size: 1rem;
}

/* ===========================
   PROGRESS INDICATOR
   =========================== */
.progress-container {
    max-width: 1400px;
    margin: 1.5rem auto 0;
    padding: 0 2rem;
}

.progress-bar-bg {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 25%;
    transition: width 0.4s ease;
}

.step-indicators {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.step-indicator {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.step-indicator.active,
.step-indicator.completed {
    opacity: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.step-indicator.active .step-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transform: scale(1.1);
}

.step-indicator.completed .step-number {
    background: #4caf50;
    color: white;
}

.step-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
    text-align: center;
}

.step-indicator.active .step-label {
    color: #764ba2;
    font-weight: 700;
}

/* ===========================
   MAIN CONTAINER
   =========================== */
.main-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem 100px 1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ===========================
   STEP CONTAINERS
   =========================== */
.step-container {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    animation: fadeIn 0.4s ease;
}

.step-container.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-header {
    text-align: center;
    margin-bottom: 2rem;
}

.step-header h2 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.step-header p {
    color: #666;
    font-size: 1rem;
}

.step-body {
    width: 100%;
}

.step-body.two-column {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    align-items: start;
}

.preview-box.small {
    height: 300px;
    max-width: 400px;
    margin: 0 auto;
}

.preview-box.large {
    height: 500px;
    max-width: 600px;
    margin: 0 auto;
}

.color-selection-area {
    max-width: 500px;
    margin: 0 auto 2rem;
}

.control-area {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
}

.control-area h3 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 1rem;
    font-weight: 600;
}

.remove-btn {
    width: 100%;
    margin-top: 1rem;
    background: #f44336;
    color: white;
}

.remove-btn:hover {
    background: #d32f2f;
}

/* ===========================
   INSTRUCTION TEXT
   =========================== */
.instruction-text {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 1rem;
    color: #856404;
    font-size: 0.95rem;
    margin-top: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.instruction-text.shown {
    opacity: 1;
}

/* ===========================
   REVIEW SUMMARY
   =========================== */
.review-summary {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.review-summary h3 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.2rem;
}

.summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    font-weight: 600;
    color: #666;
}

.summary-value {
    flex: 1;
    text-align: center;
    color: #333;
    font-weight: 500;
}

.btn-edit {
    padding: 0.5rem 1rem;
    background: #764ba2;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

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

.review-grid {
    grid-template-columns: repeat(2, 1fr);
}

.preview-inner {
    position: relative;
    width: 100%;
    height: 100%;
}

/* ===========================
   NAVIGATION BUTTONS
   =========================== */
.navigation-buttons {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    z-index: 90;
}

.nav-btn {
    padding: 1rem 2rem;
    font-size: 1rem;
    min-width: 120px;
}

.prev-btn {
    background: #e0e0e0;
    color: #333;
}

.prev-btn:hover {
    background: #d0d0d0;
}

.next-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-left: auto;
}

.skip-btn {
    background: transparent;
    color: #666;
    border: 2px solid #e0e0e0;
}

.skip-btn:hover {
    border-color: #764ba2;
    color: #764ba2;
}

.order-btn {
    background: #25D366;
    color: white;
    flex: 1;
    max-width: 300px;
}

.order-btn:hover {
    background: #1da851;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.order-btn svg {
    width: 20px;
    height: 20px;
}

/* ===========================
   PREVIEW SECTION
   =========================== */
.preview-section {
    width: 100%;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 1rem;
}

.preview-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 3px solid transparent;
}

.preview-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.preview-card.active {
    border-color: #764ba2;
    box-shadow: 0 12px 40px rgba(118, 75, 162, 0.3);
    transform: translateY(-2px);
}

.preview-label {
    text-align: center;
    margin-bottom: 1rem;
}

.view-indicator {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: #e0e0e0;
    color: #666;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.view-indicator.front-active,
.view-indicator.back-active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.preview-box {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 400px;
    margin: 0 auto;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.layer, .logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.layer {
    max-width: 85%;
    max-height: 95%;
    width: auto;
    height: auto;
    pointer-events: none;
    object-fit: contain;
}

.logo {
    width: 90px;
    transition: all 0.1s ease;
}

.logo.hide {
    display: none;
}

/* ===========================
   CONTROLS SECTION
   =========================== */
.controls-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.control-group {
    margin-bottom: 2rem;
}

.controls-section .control-group:last-child {
    margin-bottom: 0;
}

.control-title {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 1rem;
    font-weight: 600;
}

#activeSide {
    color: #764ba2;
    font-weight: 700;
}

/* ===========================
   BUTTONS
   =========================== */
.btn {
    border: none;
    border-radius: 10px;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f5f5f5;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

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

.btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Button Grids */
.button-grid {
    display: grid;
    gap: 1rem;
}

.color-grid, .view-grid {
    grid-template-columns: repeat(2, 1fr);
}

.size-grid {
    grid-template-columns: repeat(4, 1fr);
}

.logo-grid {
    grid-template-columns: repeat(4, 1fr);
}

/* Color Swatches */
.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    display: inline-block;
}

.putih-swatch {
    background: white;
    border-color: #ccc;
}

.hitam-swatch {
    background: #1a1a1a;
}

/* Logo Buttons */
.logo-btn {
    flex-direction: column;
    padding: 1rem;
    gap: 0.5rem;
}

.logo-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.logo-btn span {
    font-size: 0.85rem;
}

/* ===========================
   ORDER SECTION
   =========================== */
.order-section {
    width: 100%;
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.order-btn {
    width: 100%;
    background: #25D366;
    color: white;
    font-size: 1.2rem;
    padding: 1.5rem;
}

.order-btn:hover {
    background: #1da851;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.order-btn svg {
    width: 26px;
    height: 26px;
}

/* ===========================
   DRAGGABLE LOGOS
   =========================== */
.logo {
    cursor: grab;
    user-select: none;
    pointer-events: auto;
    z-index: 5;
}

.logo:active {
    cursor: grabbing;
}

.logo.dragging {
    opacity: 0.8;
    z-index: 25;
}

/* Resize Handles */
.resize-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    background: white;
    border: 2px solid #764ba2;
    border-radius: 50%;
    display: block;
    z-index: 30;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
}

.resize-handle.tl {
    top: -6px;
    left: -6px;
    cursor: nwse-resize;
}

.resize-handle.tr {
    top: -6px;
    right: -6px;
    cursor: nesw-resize;
}

.resize-handle.bl {
    bottom: -6px;
    left: -6px;
    cursor: nesw-resize;
}

.resize-handle.br {
    bottom: -6px;
    right: -6px;
    cursor: nwse-resize;
}

.logo.selected {
    outline: 2px dashed #764ba2;
    outline-offset: 4px;
}

/* ===========================
   FOOTER
   =========================== */
.footer {
    text-align: center;
    padding: 2rem;
    color: white;
    font-size: 0.9rem;
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */

/* Tablet */
@media (max-width: 1024px) {
    .step-body.two-column {
        grid-template-columns: 1fr 350px;
    }

    .preview-grid {
        gap: 1.5rem;
    }

    .preview-box {
        height: 350px;
        max-width: 350px;
    }

    .preview-box.large {
        height: 450px;
    }

    .logo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Large */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .header p {
        font-size: 0.9rem;
    }

    .progress-container {
        padding: 0 1rem;
    }

    .step-indicators {
        gap: 0.5rem;
    }

    .step-number {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .step-label {
        font-size: 0.75rem;
    }

    .main-container {
        margin: 1rem auto;
        gap: 1.5rem;
    }

    .step-container {
        padding: 1.5rem;
    }

    .step-header h2 {
        font-size: 1.5rem;
    }

    .step-body.two-column {
        grid-template-columns: 1fr;
    }

    .control-area {
        order: -1;
    }

    .preview-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .review-grid {
        grid-template-columns: 1fr;
    }

    .preview-box {
        height: 320px;
        max-width: 100%;
    }

    .preview-box.large {
        height: 400px;
    }

    .controls-section {
        padding: 1.5rem;
    }

    .order-section {
        padding: 1.5rem;
    }

    .size-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .logo-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .logo-thumbnail {
        width: 40px;
        height: 40px;
    }

    .logo-btn span {
        font-size: 0.75rem;
    }

    .navigation-buttons {
        padding: 1rem;
    }

    .nav-btn {
        padding: 0.875rem 1.25rem;
        min-width: 100px;
        font-size: 0.9rem;
    }
}

/* Mobile Small */
@media (max-width: 480px) {
    .main-container {
        padding: 0 0.75rem 100px 0.75rem;
    }

    .step-container {
        padding: 1.5rem 1rem;
    }

    .step-header h2 {
        font-size: 1.4rem;
    }

    .preview-card {
        padding: 1rem;
    }

    .preview-box {
        height: 280px;
    }

    .preview-box.large {
        height: 320px;
    }

    .controls-section {
        padding: 1rem;
    }

    .order-section {
        padding: 1rem;
    }

    .control-title {
        font-size: 1rem;
    }

    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .logo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .logo-btn {
        padding: 0.75rem;
    }

    .logo-thumbnail {
        width: 45px;
        height: 45px;
    }

    .color-swatch {
        width: 20px;
        height: 20px;
    }

    .order-btn {
        font-size: 1rem;
        padding: 1.25rem;
    }

    .order-btn svg {
        width: 22px;
        height: 22px;
    }

    .instruction-text {
        font-size: 0.85rem;
        padding: 0.75rem;
    }

    .nav-btn {
        padding: 0.75rem 1rem;
        min-width: 80px;
        font-size: 0.85rem;
    }
}

/* Very Small Mobile */
@media (max-width: 360px) {
    .header h1 {
        font-size: 1.25rem;
    }

    .preview-box {
        height: 250px;
    }

    .btn {
        font-size: 0.85rem;
        padding: 0.65rem 0.85rem;
    }

    .logo-thumbnail {
        width: 35px;
        height: 35px;
    }
}
