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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --error-color: #ef4444;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 2rem 1rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    animation: fadeIn 0.5s ease-in;
}

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

header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.header-logo-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.header-logo {
    height: 60px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

header h1 {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin: 0;
    font-weight: 700;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.form-section {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.form-section h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.social-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.social-media-grid .form-group {
    margin-bottom: 0;
}

.color-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.font-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

input[type="color"] {
    width: 80px;
    height: 50px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    background: none;
    transition: all 0.3s ease;
}

input[type="color"]:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 6px;
}

.color-text-input {
    flex: 1;
    font-family: monospace;
    font-size: 0.95rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.required {
    color: var(--error-color);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236366f1' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.font-select {
    font-family: inherit;
}

/* Custom Font Dropdown */
.custom-font-dropdown {
    position: relative;
    width: 100%;
}

.font-dropdown-button {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-right: 2.5rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    text-align: left;
}

.font-dropdown-button:hover {
    border-color: var(--primary-color);
}

.font-dropdown-button:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.font-dropdown-button.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.font-preview-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.font-dropdown-arrow {
    color: var(--primary-color);
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.font-dropdown-button.active .font-dropdown-arrow {
    transform: rotate(180deg);
}

.font-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.25rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

.font-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--bg-color);
}

.font-option:last-child {
    border-bottom: none;
}

.font-option:hover {
    background: var(--bg-color);
}

.font-option.selected {
    background: rgba(99, 102, 241, 0.1);
    border-left: 3px solid var(--primary-color);
}

.font-option-preview {
    display: block;
    font-size: 1rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Scrollbar styling for dropdown */
.font-dropdown-menu::-webkit-scrollbar {
    width: 8px;
}

.font-dropdown-menu::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

.font-dropdown-menu::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.font-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.file-upload-wrapper {
    position: relative;
}

input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.file-upload-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-display:hover {
    border-color: var(--primary-color);
    background: #f8f9ff;
}

.file-name {
    flex: 1;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.btn-browse {
    padding: 0.5rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-browse:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.preview-container {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.preview-container.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 2px solid var(--border-color);
}

.preview-item img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 200px;
    object-fit: cover;
}

.preview-item .remove-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.preview-item .remove-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow);
}

.form-actions {
    text-align: center;
    margin-top: 2rem;
}

.upload-progress-container {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.progress-bar-wrapper {
    width: 100%;
}

.progress-bar {
    width: 100%;
    height: 24px;
    background: #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    margin-bottom: 0.75rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 12px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.progress-text span:first-child {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1rem;
}

.btn-submit {
    padding: 1rem 3rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    min-width: 200px;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.message {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 12px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.success {
    background: #d1fae5;
    border: 2px solid var(--success-color);
    color: #065f46;
}

.message.error {
    background: #fee2e2;
    border: 2px solid var(--error-color);
    color: #991b1b;
}

.message h3 {
    margin-bottom: 0.5rem;
}

/* Brand Ambassadors Section */
.section-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.brand-ambassador-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.brand-ambassador-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.brand-ambassador-header h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin: 0;
}

.btn-remove-brand {
    padding: 0.5rem 1rem;
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-remove-brand:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-add-brand {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.btn-add-brand:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.brand-limit-text {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    margin-left: 0.5rem;
}

.brand-logo-preview {
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
    }

    .header-logo-title {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .header-logo {
        height: 50px;
        max-width: 150px;
    }

    header h1 {
        font-size: 2rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .social-media-grid {
        grid-template-columns: 1fr;
    }

    .preview-container.grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

