/* PagesVN Card Designer Styles */

:root {
    --hi-colors-bg-surface: #ffffff;
    --hi-colors-primary: #ec4899;
    --hi-colors-gray-50: #fafafa;
    --hi-colors-gray-100: #f7fafc;
    --hi-colors-gray-200: #edf2f7;
    --hi-colors-gray-300: #e2e8f0;
    --hi-colors-gray-400: #cbd5e0;
    --hi-colors-gray-500: #a0aec0;
    --hi-colors-gray-600: #718096;
    --hi-colors-gray-700: #4a5568;
    --hi-colors-gray-800: #2d3748;
    --hi-colors-gray-900: #1a202c;
    --hi-colors-company-200: #fcf4ff;
    --hi-colors-bg-canvas: #ffffff;
    --hi-colors-transparent: transparent;
    --hi-colors-whiteAlpha-300: rgba(255, 255, 255, 0.08);
    --hi-space-2: 0.5rem;
    --hi-space-3: 0.75rem;
    --hi-space-4: 1rem;
    --hi-space-6: 1.5rem;
    --hi-space-8: 2rem;
    --hi-radii-md: 0.375rem;
    --hi-radii-lg: 0.5rem;
    --hi-radii-xl: 0.75rem;
    --hi-radii-2xl: 1rem;
    --hi-shadows-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --hi-shadows-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --hi-shadows-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --hi-shadows-innerRight: inset -1px 0 0 0 rgba(0, 0, 0, 0.1);
    --hi-shadows-none: none;
    --hi-sizes-10: 2.5rem;
    --hi-sizes-full: 100%;
    /* PagesVN skeleton colors */
    --skeleton-start-color: #e2e8f0;
    --skeleton-end-color: #f7fafc;
}

/* Base Layout Styles */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background-color: #f5f5f7;
}

.designer-container {
    display: flex;
    min-height: 100vh;
    gap: 20px;
    padding: 20px;
}

/* Control Panel Styles */
.control-panel {
    width: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 24px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.control-section {
    margin-bottom: 32px;
}

.control-section h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a202c;
}

/* Design Selector with SVG */
.design-options {
    display: flex;
    gap: var(--hi-space-3);
    flex-wrap: wrap;
}

.design-option {
    position: relative;
    cursor: pointer;
    display: block;
}

.design-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.design-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--hi-space-2);
    padding: var(--hi-space-3);
    border-radius: var(--hi-radii-lg);
    transition: all 0.2s ease;
    border: 2px solid transparent;
    min-width: 80px;
}

.design-content:hover {
    background: var(--hi-colors-gray-50);
}

.design-content.selected {
    border-color: var(--hi-colors-primary);
    background: #fdf2f8;
}

.design-svg {
    color: var(--hi-colors-gray-600);
    transition: color 0.2s ease;
}

.design-content.selected .design-svg {
    color: var(--hi-colors-primary);
}

.design-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--hi-colors-gray-700);
    text-align: center;
}

.design-content.selected .design-label {
    color: var(--hi-colors-primary);
}

/* Tab Navigation Styles */
.tab-navigation {
    display: flex;
    border-bottom: 1px solid var(--hi-colors-gray-200);
    margin-bottom: var(--hi-space-4);
}

.tab-button {
    display: flex;
    align-items: center;
    gap: var(--hi-space-2);
    padding: var(--hi-space-3) var(--hi-space-4);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--hi-colors-gray-600);
    transition: all 0.2s ease;
    flex: 1;
    justify-content: center;
}

.tab-button:hover {
    color: var(--hi-colors-gray-800);
    background: var(--hi-colors-gray-50);
}

.tab-button.active {
    color: var(--hi-colors-primary);
    border-bottom-color: var(--hi-colors-primary);
    background: #fdf2f8;
}

.tab-content {
    min-height: 300px;
}

.tab-pane {
    display: block;
}

/* Contact Tab Styles */
.contact-category {
    margin-bottom: var(--hi-space-6);
}

.contact-category h4 {
    margin: 0 0 var(--hi-space-3) 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--hi-colors-gray-700);
}

.contact-fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--hi-space-2);
}

.contact-field {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    border: 1px solid var(--hi-colors-gray-200);
    border-radius: var(--hi-radii-md);
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    position: relative;
}

.contact-field:hover {
    border-color: var(--hi-colors-gray-300);
    background: var(--hi-colors-gray-50);
}

.contact-field.active {
    border-color: var(--hi-colors-primary);
    background: #fdf2f8;
    color: var(--hi-colors-primary);
}

.contact-field svg {
    color: var(--hi-colors-gray-500);
    transition: color 0.2s ease;
}

.contact-field.active svg {
    color: var(--hi-colors-primary);
}

.contact-field span {
    font-size: 12px;
    font-weight: 500;
    color: var(--hi-colors-gray-600);
    text-align: center;
    transition: color 0.2s ease;
}

.contact-field.active span {
    color: var(--hi-colors-primary);
}

.active-contacts {
    margin-top: var(--hi-space-6);
    padding-top: var(--hi-space-4);
    border-top: 1px solid var(--hi-colors-gray-200);
}

.active-contacts h4 {
    margin: 0 0 var(--hi-space-3) 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--hi-colors-gray-700);
}

.active-contact-list {
    display: flex;
    flex-direction: column;
    gap: var(--hi-space-3);
}

.contact-input-group {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.contact-input-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--hi-colors-gray-600);
    margin-bottom: 6px;
}

.contact-input-group input {
    width: 100%;
    padding: 8px 36px 8px 12px;
    border: 1px solid var(--hi-colors-gray-300);
    border-radius: var(--hi-radii-md);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.contact-input-group input:focus {
    border-color: var(--hi-colors-primary);
}

.remove-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(10%);
    width: 18px;
    height: 18px;
    border: none;
    background: var(--hi-colors-gray-400);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

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

/* Preview Panel Styles */
.preview-panel {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 40px;
}

/* Card Wrapper Base Styles */
.CardWrapper {
    width: 400px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.CardLayoutFlat {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

/* Header Styles */
.CardHeaderFlat {
    background: var(--hi-colors-primary);
    height: 120px;
    position: relative;
    overflow: hidden;
}

.CardLogo {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
}

.CardLogo img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

/* Bank Information Designer Styles */
.bank-info-section {
    margin-top: 20px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.toggle-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #cbd5e0;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--hi-colors-primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.bank-fields {
    display: grid;
    gap: 12px;
}

.bank-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bank-field-group label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
}

.bank-field-group input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.bank-field-group input:focus {
    border-color: var(--hi-colors-primary);
}

.qr-upload-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.qr-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qr-upload-area:hover {
    border-color: var(--hi-colors-primary);
    background: #fdf2f8;
}

.qr-upload-area.has-file {
    border-color: var(--hi-colors-primary);
    background: #fdf2f8;
}

.qr-upload-input {
    display: none;
}

.qr-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.qr-upload-icon {
    color: #6b7280;
    font-size: 24px;
}

.qr-upload-text {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.qr-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.qr-preview-image,
.qr-image {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 0;
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.1);
}

.qr-preview-info {
    flex: 1;
}

.qr-preview-name {
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 2px;
}

.qr-preview-size {
    font-size: 10px;
    color: #6b7280;
}

.qr-remove-btn,
.remove-qr-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: #ef4444;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    margin-left: 8px;
}

/* Custom Color Picker Designer Styles */
.custom-color-section {
    margin-top: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.custom-color-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.custom-color-title {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.custom-color-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-color-picker {
    width: 36px;
    height: 28px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    background: transparent;
    overflow: hidden;
}

.custom-color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.custom-color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

.custom-color-display {
    flex: 1;
    padding: 6px 10px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 11px;
    color: #374151;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

/* Mobile Responsive Designer Styles */
@media (max-width: 768px) {
    .designer-container {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .control-panel {
        width: 100%;
        position: static;
        padding: 20px;
    }
    
    .preview-area {
        padding-top: 20px;
    }
    
    .CardWrapper {
        width: 100%;
        max-width: 380px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .designer-container {
        padding: 10px;
        gap: 10px;
    }
    
    .control-panel {
        padding: 16px;
    }
    
    .control-section {
        margin-bottom: 24px;
    }
    
    .control-section h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .preview-area {
        padding-top: 10px;
    }
    
    .CardWrapper {
        width: 100%;
        max-width: 340px;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        font-size: 14px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}