/* Jersey Customization Styles */
:root {
    --primary-blue: #0056b3;
    --dark-blue: #003d82;
    --light-blue: #e6f2ff;
    --medium-blue: #4d94ff;
    --pale-blue: #f0f7ff;
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --text-dark: #333333;
    --text-light: #6c757d;
    --shadow-sm: 0 2px 10px rgba(0, 86, 179, 0.08);
    --shadow-md: 0 10px 30px rgba(0, 86, 179, 0.12);
    --shadow-lg: 0 20px 40px rgba(0, 86, 179, 0.15);
}

.customization-page {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.jersey-display {
    flex: 1;
    min-width: 300px;
    background: #f9f9f9;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    height: 100%;
}

.jersey-view-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    min-height: 400px;
    background: white;
}

.jersey-view {
    display: none;
    height: 400px;
}

.jersey-view.active {
    display: block;
}

.jersey-view img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Back View Customization */
#back-view {
    position: relative;
    width: 100%;
    height: 400px;
}

#back-view img {
    filter: none;
}

.customization-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.name-display {
    font-family: 'Bebas Neue', cursive;
    font-weight: bold;
    color: #000;
    text-align: center;
    margin-bottom: -100px;
    font-size: clamp(16px, 2vw, 24px);
    text-transform: uppercase;
    position: relative;
    top: 0%;
    transform: translateY(-200%); /* Moved down from -290% */
    width: 100%;
    padding: 0 20px;
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.number-display {
    font-family: 'Bebas Neue', cursive;
    font-weight: bold;
    color: #000;
    font-size: clamp(40px, 10vw, 80px);
    line-height: 1;
    position: relative;
    top: 60%;
    transform: translateY(-250%); /* Moved down from -290% */
    width: 100%;
    text-align: center;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* View Toggle */
.view-toggle {
    display: flex;
    justify-content: center;
    margin-top: 15px;
    gap: 10px;
}

.view-toggle button {
    padding: 8px 20px;
    background: #e0e0e0;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.view-toggle button.active {
    background: var(--primary-blue);
    color: white;
}

/* Form Styles */
.customization-form {
    flex: 1;
    min-width: 300px;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    height: 100%;
}

.customization-form .card-body {
    padding: 20px;
}

.customization-form h2 {
    margin-bottom: 20px;
    color: var(--primary-blue);
    font-size: 22px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary-blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

.product-info {
    margin: 20px 0;
    padding: 15px;
    background: var(--light-gray);
    border-radius: 6px;
    text-align: center;
}

.product-info h4 {
    margin-bottom: 5px;
    color: var(--text-dark);
}

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

/* Color Picker Styles */
.form-control-color {
    width: 50px;
    height: 38px;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 6px;
}

/* Mobile-optimized styles */
@media (max-width: 1200px) {
    .name-display {
        font-size: 20px;
        top: 0%;
        transform: translateY(-240%);
    }
    .number-display {
        font-size: 70px;
        transform: translateY(-240%);
    }
}

@media (max-width: 992px) {
    .jersey-view-container {
        min-height: 350px;
    }
    
    .jersey-view {
        height: 350px;
    }
    
    .name-display {
        top: 0%;
        transform: translateY(-230%);
    }
    .number-display {
        top: 20%;
        transform: translateY(-230%);
    }
}

@media (max-width: 768px) {
    .customization-page {
        padding: 0.5rem;
    }
    
    .jersey-view-container {
        min-height: 300px;
    }
    
    .jersey-view {
        height: 300px;
    }
    
    .name-display {
        top: -12%;
        transform: translateY(-200%); /* Moved down significantly for mobile */
        font-size: clamp(14px, 4vw, 18px);
    }
    .number-display {
        top: 30%;
        transform: translateY(-200%); /* Moved down significantly for mobile */
        font-size: clamp(36px, 10vw, 60px);
    }
    
    .customization-form .card-body {
        padding: 15px;
    }
    
    .customization-form h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .view-toggle button {
        padding: 6px 15px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .jersey-view-container {
        min-height: 280px;
    }
    
    .jersey-view {
        height: 280px;
    }
    
    .name-display {
        top: -9%;
        transform: translateY(-180%); /* Even more down for very small screens */
        font-size: clamp(12px, 5vw, 16px);
        padding: 0 15px;
    }
    .number-display {
        top: 28%;
        transform: translateY(-180%); /* Even more down for very small screens */
        font-size: clamp(32px, 12vw, 50px);
    }
    
    .customization-form .card-body {
        padding: 10px;
    }
    
    .customization-form h2 {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .product-info {
        margin: 15px 0;
        padding: 10px;
    }
    
    .view-toggle {
        margin-top: 10px;
    }
    
    .view-toggle button {
        padding: 5px 12px;
        font-size: 13px;
    }
}

/* Enhanced mobile form elements */
@media (max-width: 768px) {
    .form-control-lg {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 15px;
    }
    
    .form-select-lg {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 15px;
    }
    
    .btn-lg {
        padding: 12px 20px;
        font-size: 16px;
    }
}

/* Touch-friendly spacing */
@media (max-width: 768px) {
    .mb-3 {
        margin-bottom: 1rem !important;
    }
    
    .g-3 > * {
        padding: 0.5rem !important;
    }
}