/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Stone color palette */
    --stone-50: #fafaf9;
    --stone-100: #f5f5f4;
    --stone-200: #e7e5e4;
    --stone-300: #d6d3d1;
    --stone-400: #a8a29e;
    --stone-500: #78716c;
    --stone-600: #57534e;
    --stone-700: #44403c;
    --stone-800: #292524;
    --stone-900: #1c1917;
    
    /* Light mode using stone palette */
    --bg-primary: var(--stone-50);
    --bg-secondary: #ffffff;
    --text-primary: var(--stone-900);
    --text-secondary: var(--stone-600);
    --text-muted: var(--stone-400);
    --border-color: var(--stone-200);
    --accent: var(--stone-900);
    --accent-hover: var(--stone-700);
    
    /* Dark mode colors */
    --bg-primary-dark: var(--stone-900);
    --bg-secondary-dark: var(--stone-800);
    --text-primary-dark: var(--stone-50);
    --text-secondary-dark: var(--stone-400);
    --border-color-dark: var(--stone-700);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 0;
    overflow-x: hidden;
    display: flex;
    align-items: stretch;
}

.container {
    width: 100%;
    display: flex;
    flex-direction: row;
    min-height: 100vh;
    animation: fadeUp 0.6s ease-out;
}

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

/* Header */
.header {
    text-align: center;
    margin-bottom: 2rem;
    padding-top: 16px;
    padding-bottom: 16px;
}

.header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--stone-300);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    text-align: center;
}

.subtitle {
    color: var(--stone-300);
    font-size: 1rem;
    font-weight: 400;
    text-align: center;
}

/* Top Actions (Language Selector and Help Button) */
.top-actions {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 100;
}

.btn-help-fixed {
    padding: 0.5rem 0.875rem;
    background: var(--stone-50);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-help-fixed:hover {
    background: var(--stone-100);
    border-color: var(--stone-300);
    transform: translateY(-1px);
}

.btn-help-fixed .icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

/* Language Selector */
.language-selector {
    position: relative;
}

.btn-language {
    padding: 0.5rem 0.875rem;
    background: var(--stone-50);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-language:hover {
    background: var(--stone-100);
    border-color: var(--stone-300);
    transform: translateY(-1px);
}

.btn-language .icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.btn-language #currentLangFlag {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.btn-language #currentLangFlag svg {
    width: 20px;
    height: 15px;
    border-radius: 2px;
}

.btn-language #currentLangCode {
    font-weight: normal;
    min-width: 28px;
    text-align: center;
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border: 1px solid var(--stone-200);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-width: 140px;
    z-index: 1000;
}

.lang-option {
    width: 100%;
    padding: 0.75rem 1rem;
    background: white;
    border: none;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.lang-flag-svg {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    width: 24px;
    justify-content: center;
}

.lang-flag-svg svg {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.lang-name {
    flex: 1;
}

.lang-option:hover {
    background: var(--stone-50);
}

.lang-option:first-child {
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.lang-option:last-child {
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* CSV Section */
.csv-section {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 100;
}

.csv-section .btn {
    width: auto;
    justify-content: center;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
}

.csv-section .btn:hover {
    transform: translateY(-2px);
}

.csv-results {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.csv-results.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.csv-results.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.csv-results.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Sidebar */
.sidebar {
    width: 450px;
    background: var(--stone-50);
    border-right: 1px solid var(--stone-200);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.sidebar-header {
    padding: 16px 2rem;
    border-bottom: 1px solid var(--stone-200);
    background: var(--stone-50);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.sidebar-header svg {
    width: 100%;
    max-width: 184px;
    height: auto;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--stone-900);
    margin: 0;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 2rem 1rem 2rem;
}

.sidebar-footer {
    padding: 16px 2rem;
    border-top: 1px solid var(--stone-200);
    background: var(--stone-50);
    flex-shrink: 0;
}

.sidebar-footer .btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
}

.sidebar-footer .logo-upload-btn-premium {
    width: 100%;
}

.tooltip-trigger {
    position: relative;
}

.tooltip-text {
    visibility: hidden;
    opacity: 0;
    width: 280px;
    background-color: var(--stone-900);
    color: var(--stone-50);
    text-align: left;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    position: absolute;
    z-index: 1000;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    line-height: 1.5;
    font-weight: 400;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    white-space: normal;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: var(--stone-900) transparent transparent transparent;
}

.tooltip-trigger:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.sidebar-footer p {
    font-size: 0.75rem;
    color: var(--stone-500);
    margin: 0 0 1rem 0;
    text-align: center;
    line-height: 1.5;
}

.btn-template-download {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: none;
    border: none;
    color: var(--stone-900);
    font-size: 0.75rem;
    cursor: pointer;
    transition: opacity 0.2s ease;
    margin-top: 0.5rem;
}

.btn-template-download:hover {
    opacity: 0.7;
}

.btn-template-download .icon {
    width: 1rem;
    height: 1rem;
}

/* Preview section */
.preview-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
    height: 100vh;
}

/* Main content layout */

/* Preview section */
.preview-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    padding-bottom: 6rem;
    overflow-y: auto;
    height: 100vh;
    position: relative;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

/* Form grid */
.form-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-section-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
}

.section-title {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--stone-400);
    margin: 0;
    margin-bottom: -0.5rem;
}

/* Premium Logo Upload Button - Designer Level */
.logo-upload-btn-premium {
    position: relative;
    padding: 0;
    background: linear-gradient(135deg, #ffffff 0%, #fafaf9 100%);
    border: 1px solid var(--stone-200);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 1rem;
    width: 100%;
    min-height: 120px;
}

/* Drag & drop states */
.logo-upload-btn-premium.drag-over {
    border-color: var(--stone-400);
    background: linear-gradient(135deg, var(--stone-50) 0%, var(--stone-100) 100%);
    transform: scale(1.02);
}

.logo-upload-btn-premium:hover {
    border-color: var(--stone-300);
    transform: translateY(-1px);
}

.logo-upload-btn-premium:active {
    transform: translateY(0);
}

.logo-btn-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    flex: 1;
    width: 100%;
    min-width: 0;
}

.logo-btn-content-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    position: relative;
}

.sidebar-footer .logo-btn-content {
    position: relative;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
}

.sidebar-footer .logo-upload-btn-premium {
    min-height: auto;
    height: auto;
}

.sidebar-footer .logo-btn-content:hover::after {
    content: "see more";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0.5rem;
    padding: 0.375rem 0.625rem;
    background: var(--stone-900);
    color: white;
    font-size: 0.75rem;
    font-weight: 400;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    animation: tooltipFadeIn 0.2s ease forwards;
    z-index: 10000;
}

.sidebar-footer .logo-btn-content:hover::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0.25rem;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--stone-900);
    opacity: 0;
    pointer-events: none;
    animation: tooltipFadeIn 0.2s ease forwards;
    z-index: 10000;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.logo-btn-icon-wrapper {
    width: 44px;
    height: 44px;
    min-width: 44px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--stone-100) 0%, var(--stone-50) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--stone-200);
    overflow: hidden;
}

.logo-btn-icon-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.logo-upload-btn-premium:hover .logo-btn-icon-wrapper {
    transform: scale(1.05) rotate(-2deg);
    background: linear-gradient(135deg, var(--stone-200) 0%, var(--stone-100) 100%);
    border-color: var(--stone-300);
}

.logo-btn-icon {
    width: 24px;
    height: 24px;
    stroke: var(--stone-700);
    transition: all 0.3s ease;
}

.logo-upload-btn-premium:hover .logo-btn-icon {
    stroke: var(--stone-900);
}

.logo-btn-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    text-align: left;
    flex: 1;
}

.logo-btn-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--stone-900);
    letter-spacing: -0.01em;
    transition: color 0.3s ease;
    line-height: 1.3;
}

.logo-btn-subtitle {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--stone-500);
    letter-spacing: 0.01em;
    transition: color 0.3s ease;
    line-height: 1.4;
}

.logo-upload-btn-premium:hover .logo-btn-title {
    color: var(--stone-950);
}

.logo-upload-btn-premium:hover .logo-btn-subtitle {
    color: var(--stone-600);
}

.logo-btn-indicator {
    margin-left: auto;
    display: flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.logo-btn-arrow {
    width: 18px;
    height: 18px;
    stroke: var(--stone-400);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-btn-remove {
    width: 18px;
    height: 18px;
    stroke: var(--stone-400);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-btn-indicator:hover .logo-btn-remove {
    stroke: var(--stone-800);
    transform: scale(1.1);
}

.logo-upload-btn-premium:hover .logo-btn-arrow {
    transform: translateX(3px);
    stroke: var(--stone-600);
}

.logo-link-wrapper {
    width: 100%;
}

/* Inline URL input within logo-btn-content */
.logo-url-input-inline {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    margin-top: 0.5rem;
    flex-shrink: 0;
    min-width: 0;
}

.logo-url-input-inline .input-icon {
    position: absolute;
    left: 0.75rem;
    width: 18px;
    height: 18px;
    z-index: 1;
    pointer-events: none;
    color: var(--stone-300);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-url-input-inline input {
    width: 100%;
    min-width: 0;
    padding: 0.625rem 2.5rem 0.625rem 2.5rem;
    border: 1px solid var(--stone-200);
    border-radius: 8px;
    font-size: 0.875rem;
    background: var(--stone-100);
    color: var(--text-primary);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.logo-url-input-inline input::placeholder {
    color: var(--stone-400);
    opacity: 1;
}

.logo-url-input-inline input:focus {
    outline: none;
    border-color: var(--stone-400);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.logo-url-input-inline .clear-btn {
    position: absolute;
    right: 0.5rem;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--stone-400);
    transition: color 0.2s ease;
    z-index: 2;
}

.logo-url-input-inline .clear-btn:hover {
    color: var(--stone-700);
}

.logo-url-input-inline .clear-btn svg {
    width: 16px;
    height: 16px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 0.75rem;
    width: 18px;
    height: 18px;
    z-index: 1;
    pointer-events: none;
    color: var(--stone-300);
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-icon svg {
    width: 100%;
    height: 100%;
}

.icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.input-wrapper input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    background: white;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.input-wrapper input::placeholder {
    color: var(--stone-400);
    opacity: 1;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--stone-300);
    background: white;
}

.clear-btn {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

.input-wrapper:hover .clear-btn,
.input-wrapper input:focus ~ .clear-btn,
.input-wrapper input:not(:placeholder-shown) ~ .clear-btn {
    opacity: 1;
}

.clear-btn:hover {
    color: var(--text-primary);
}

/* Color Picker Styles */
.color-picker-wrapper {
    position: relative;
}

.color-picker-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: calc((43.5px - 24px) / 2) 2.5rem calc((43.5px - 24px) / 2) calc((43.5px - 24px) / 2);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
    height: 43.5px;
}

.color-picker-container:hover {
    border-color: var(--stone-300);
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid var(--stone-200);
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
    box-sizing: border-box;
}

.color-swatch:hover {
    transform: scale(1.05);
}

.color-hex-input {
    flex: 1;
    border: none !important;
    background: transparent;
    font-size: 0.875rem;
    color: var(--text-primary);
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    padding: 0 !important;
    margin: 0 !important;
    cursor: text;
    outline: none;
}

.color-hex-input::placeholder {
    color: var(--stone-400);
    opacity: 1;
}

.color-hex-input:focus {
    outline: none;
    border: none !important;
    padding: 0 !important;
}

/* Preview area */
.preview-area {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
    width: 100%;
    max-width: 600px;
}

.toggles-container {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.preview-area h2 {
    font-size: 1rem;
    font-weight: 400;
    color: var(--stone-500);
    margin-bottom: 0;
    text-align: left;
}

.preview {
    position: relative;
    min-height: 180px;
    max-height: 60vh;
    padding: 2rem;
    border: 1px solid var(--stone-200);
    border-radius: 16px;
    background: white;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1), margin 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 700px;
    max-width: 700px;
    overflow-y: auto;
    will-change: width, max-width;
}

.preview-content {
    position: relative;
    z-index: 1;
    /* Protection contre le copier-coller */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
}

/* Désactiver la sélection de texte dans la preview */
.preview {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Permettre les liens à rester cliquables tout en empêchant la sélection */
.preview-content a,
.signature-content a {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: auto;
    cursor: pointer;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
}

/* Empêcher la sélection de texte dans le contenu de la signature */
.signature-content {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.signature-content * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
}

/* Exception pour les liens - ils doivent rester cliquables */
.signature-content a,
.signature-content a * {
    pointer-events: auto;
    cursor: pointer;
}

.theme-toggle {
    position: relative;
    width: 70px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--stone-300);
    background: var(--stone-100);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 4px;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
    align-self: center;
    margin-left: -10px;
    margin-top: -2px;
}

.theme-toggle-slider {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: white;
    transition: transform 0.3s ease, background 0.3s ease;
    left: 2px;
    top: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle.dark-mode .theme-toggle-slider {
    transform: translateX(36px);
    background: var(--stone-700);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    z-index: 2;
    transition: opacity 0.3s ease;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.theme-toggle .icon-sun {
    opacity: 1;
    stroke: var(--stone-700);
    left: 7px;
}

.theme-toggle .icon-moon {
    opacity: 0.5;
    stroke: var(--stone-700);
    left: 43px;
}

.theme-toggle.dark-mode {
    background: var(--stone-800);
    border-color: var(--stone-600);
}

.theme-toggle.dark-mode .icon-sun {
    opacity: 0.5;
    stroke: var(--stone-200);
    left: 7px;
}

.theme-toggle.dark-mode .icon-moon {
    opacity: 1;
    stroke: var(--stone-200);
    left: 43px;
}

.theme-toggle.dark-mode {
    background: var(--stone-800);
    border-color: var(--stone-600);
}

.theme-toggle.dark-mode .icon-sun {
    opacity: 0.5;
    stroke: var(--stone-200);
    left: 7px;
}

.theme-toggle:hover {
    border-color: var(--stone-400);
}

.theme-toggle.dark-mode:hover {
    border-color: var(--stone-500);
}


/* View mode toggle icons (desktop/phone) */
.theme-toggle .icon-desktop {
    opacity: 1;
    stroke: var(--stone-700);
    left: 7px;
}

.theme-toggle .icon-phone {
    opacity: 0.5;
    stroke: var(--stone-700);
    left: 43px;
}

.theme-toggle.dark-mode .icon-desktop {
    opacity: 0.5;
    stroke: var(--stone-200);
    left: 7px;
}

.theme-toggle.dark-mode .icon-phone {
    opacity: 1;
    stroke: var(--stone-200);
    left: 43px;
}

/* View mode toggle - always white background */
#viewModeToggle {
    background: var(--stone-100) !important;
    border-color: var(--stone-300) !important;
}

#viewModeToggle.dark-mode {
    background: var(--stone-100) !important;
    border-color: var(--stone-300) !important;
}

#viewModeToggle.dark-mode .theme-toggle-slider {
    background: white !important;
}

#viewModeToggle .icon-desktop,
#viewModeToggle .icon-phone {
    stroke: var(--stone-700) !important;
}

#viewModeToggle.dark-mode .icon-desktop {
    opacity: 0.5;
    stroke: var(--stone-700) !important;
}

#viewModeToggle.dark-mode .icon-phone {
    opacity: 1;
    stroke: var(--stone-700) !important;
}

#viewModeToggle:hover {
    border-color: var(--stone-400) !important;
}

#viewModeToggle.dark-mode:hover {
    border-color: var(--stone-400) !important;
}


.preview-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 153px;
    color: var(--stone-400);
    font-style: italic;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}


.preview-placeholder.hidden {
    display: none;
}

/* Signature HTML output styling */
.signature-content {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: -0.03em;
    line-height: 1.6;
    color: var(--stone-900);
    position: relative;
    z-index: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.signature-logo img {
    max-height: 50px;
    width: auto;
}

.signature-name {
    font-weight: 700;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.9);
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.signature-title {
    font-weight: 400;
    color: rgba(0, 0, 0, 0.4);
    font-size: 14px;
    margin-bottom: 0.25rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.signature-contact {
    color: rgba(0, 0, 0, 0.7);
    font-size: 14px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.signature-contact a {
    color: rgba(0, 0, 0, 0.7);
    text-decoration: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.signature-contact a:hover {
    text-decoration: underline;
}

.signature-contact-link,
.signature-website a,
.signature-website .signature-contact-link {
    color: rgba(0, 0, 0, 0.7) !important;
    text-decoration: none;
}

.signature-social {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 0;
}

.signature-social a {
    display: inline-block;
    margin-right: 8px;
    color: rgba(0, 0, 0, 0.7);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.signature-social a:hover {
    opacity: 0.7;
}

.signature-social svg {
    display: block;
    width: 18px;
    height: 18px;
    fill: rgba(0, 0, 0, 0.3);
}

.signature-social-icon-path {
    fill: rgba(0, 0, 0, 0.3);
}

/* CSV Navigation - Bottom Fixed */
.csv-navigation-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 1.5rem auto 0 auto;
    width: fit-content;
}

.csv-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    background: var(--stone-100);
    border: 1px solid var(--stone-200);
    border-radius: 8px;
    padding: 0 0.5rem;
    transition: all 0.15s ease;
    cursor: pointer;
}

.csv-action-btn.csv-nav-duplicate,
.csv-action-btn.csv-nav-delete {
    width: 36px;
    padding: 0;
}

.csv-duplicate-text {
    margin-left: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--stone-700);
}

/* Notifications */
.notification-container {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    pointer-events: none;
}

.notification {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.25rem;
    background: white;
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    min-width: 280px;
    max-width: 400px;
    pointer-events: auto;
    animation: notificationSlideIn 0.3s ease forwards;
}

.notification.success {
    background: #10B981;
    color: white;
}

.notification.error {
    background: #DC2626;
    color: white;
}

.notification-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.notification.success .notification-icon {
    stroke: white;
}

.notification.error .notification-icon {
    stroke: white;
}

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

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

.csv-action-btn:hover {
    border-color: var(--stone-400);
}

.csv-navigation-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0.25rem 0;
    width: fit-content;
}

.csv-navigation-bottom {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0;
    background: white;
    border: 1px solid var(--stone-200);
    border-radius: 12px;
    padding: 0.5rem 0.75rem;
    box-shadow: 0 4px 16px rgba(28, 25, 23, 0.1);
    z-index: 100;
}

.csv-nav-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.csv-navigation-inline .csv-nav-btn:hover:not(:disabled) {
    background: white;
}

.csv-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.csv-navigation-inline .csv-nav-btn .icon {
    width: 16px;
    height: 16px;
    stroke: var(--stone-600);
    transition: stroke 0.15s ease;
}

.csv-navigation-inline .csv-nav-btn:hover:not(:disabled) .icon {
    stroke: var(--stone-900);
}

.csv-navigation-inline .csv-nav-counter {
    padding: 0;
    font-weight: 400;
    color: var(--stone-700);
    font-size: 0.875rem;
    min-width: 50px;
    text-align: center;
    letter-spacing: 0.01em;
    font-variant-numeric: tabular-nums;
}

.csv-action-btn.csv-nav-delete {
    position: relative;
}

.csv-action-btn.csv-nav-delete .icon {
    width: 18px;
    height: 18px;
    stroke: var(--stone-600);
    transition: stroke 0.15s ease;
}

.csv-action-btn.csv-nav-delete:hover {
    border-color: #DC2626;
}

.csv-action-btn.csv-nav-delete:hover .icon {
    stroke: #DC2626;
}

.csv-action-btn.csv-nav-duplicate {
    position: relative;
}

.csv-action-btn.csv-nav-duplicate .icon {
    width: 18px;
    height: 18px;
    stroke: var(--stone-600);
    transition: stroke 0.15s ease;
}

.csv-action-btn.csv-nav-duplicate:hover .icon {
    stroke: var(--stone-900);
}

/* Tooltip for duplicate button - only when data-tooltip attribute is present (small version) */
.csv-action-btn.csv-nav-duplicate[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0.5rem;
    padding: 0.375rem 0.625rem;
    background: var(--stone-900);
    color: white;
    font-size: 0.75rem;
    font-weight: 400;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    animation: tooltipFadeIn 0.2s ease forwards;
    z-index: 10000;
}

.csv-action-btn.csv-nav-duplicate[data-tooltip]:hover::before {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0.25rem;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid var(--stone-900);
    opacity: 0;
    pointer-events: none;
    animation: tooltipFadeIn 0.2s ease forwards;
    z-index: 10000;
}

.csv-action-btn.csv-nav-delete:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0.5rem;
    padding: 0.375rem 0.625rem;
    background: var(--stone-900);
    color: white;
    font-size: 0.75rem;
    font-weight: 400;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    animation: tooltipFadeIn 0.2s ease forwards;
    z-index: 10000;
}

.csv-action-btn.csv-nav-delete:hover::before {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0.25rem;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid var(--stone-900);
    opacity: 0;
    pointer-events: none;
    animation: tooltipFadeIn 0.2s ease forwards;
    z-index: 10000;
}


.csv-nav-counter {
    padding: 0 0.75rem;
    font-weight: 500;
    color: var(--stone-900);
    font-size: 0.875rem;
    min-width: 50px;
    text-align: center;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}

/* Buttons */
.preview-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 0 2rem 2rem 2rem;
    background: transparent;
    z-index: 50;
    flex-wrap: wrap;
    width: auto;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
    min-width: 150px;
}

.preview-actions .btn-primary,
.preview-actions .btn-secondary {
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 12px 32px;
    gap: 8px;
    width: auto;
    height: 48px;
    border-radius: 8px;
    flex: none;
    order: 0;
    flex-grow: 0;
    font-weight: 300;
    font-size: 1rem;
    margin: 1rem 0 0 0;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.preview-actions .btn-primary {
    background: #8B5CF6;
    border: 1px solid #7C3AED;
    color: white;
}

.preview-actions .btn-secondary {
    background: var(--stone-100);
    border: 1px solid var(--stone-300);
    color: var(--stone-700);
}

.btn-primary:hover:not(:disabled) {
    background: #7C3AED;
    border-color: #6D28D9;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--stone-700);
    color: var(--stone-50);
    border: 1px solid var(--stone-700);
    border-radius: 12px;
    font-weight: 500;
}

.btn-secondary:hover:not(:disabled) {
    background: var(--stone-200);
    border-color: var(--stone-400);
}

.preview-actions .btn-secondary:hover:not(:disabled) {
    background: var(--stone-200);
    border-color: var(--stone-400);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--stone-50);
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-large {
    max-width: 800px;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.modal-body {
    padding: 2rem;
}

.instruction-section {
    margin-bottom: 2rem;
}

.instruction-section:last-child {
    margin-bottom: 0;
}

.instruction-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.instruction-section ol {
    margin-left: 1.5rem;
    color: var(--text-secondary);
}

.instruction-section li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.instruction-section strong {
    color: var(--text-primary);
}

/* Premium Modal Design - World-Class Level */
.modal-premium {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(28, 25, 23, 0.4);
}

.modal-logo-premium {
    max-width: 580px;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--stone-200);
}

.modal-notion {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    background: rgba(0, 0, 0, 0.3);
}

.modal-csv-notion {
    max-width: 560px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--stone-200);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.modal-csv-premium {
    max-width: 640px;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--stone-200);
}

.modal-help-notion {
    max-width: 560px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--stone-200);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Instruction Section Notion */
.instruction-section-notion {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.instruction-item-notion {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.instruction-icon-notion {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: var(--stone-50);
    border: 1px solid var(--stone-200);
    flex-shrink: 0;
}

.instruction-icon-notion svg {
    width: 20px;
    height: 20px;
}

.instruction-content-notion {
    flex: 1;
}

.instruction-title-notion {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--stone-900);
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.01em;
}

.instruction-steps-notion {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--stone-600);
    font-size: 0.8125rem;
    line-height: 1.6;
}

.instruction-steps-notion li {
    margin-bottom: 0.375rem;
}

.instruction-steps-notion li:last-child {
    margin-bottom: 0;
}

.instruction-steps-notion strong {
    color: var(--stone-900);
    font-weight: 500;
}

.modal-header-notion {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.75rem;
    border-bottom: 1px solid var(--stone-200);
}

.modal-header-notion h2 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--stone-900);
    margin: 0;
    letter-spacing: -0.01em;
}

.modal-close-notion {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease;
    color: var(--stone-500);
}

.modal-close-notion:hover {
    background: var(--stone-100);
    color: var(--stone-700);
}

.modal-close-notion svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.modal-body-notion {
    padding: 1.75rem;
}

.csv-import-section-notion {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.csv-description-notion {
    margin-bottom: 0.25rem;
}

.csv-description-notion p {
    font-size: 0.8125rem;
    color: var(--stone-600);
    line-height: 1.5;
    margin: 0;
}

.drop-zone-notion {
    position: relative;
    padding: 3rem 2rem;
    background: var(--stone-50);
    border: 1.5px dashed var(--stone-300);
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.drop-zone-notion:hover {
    border-color: var(--stone-400);
    background: var(--stone-100);
}

.drop-zone-notion.drag-over {
    border-color: var(--stone-500);
    background: var(--stone-100);
}

.drop-icon-notion {
    width: 32px;
    height: 32px;
    margin: 0 auto 0.75rem;
    color: var(--stone-500);
}

.drop-text-notion {
    font-size: 0.875rem;
    color: var(--stone-700);
    margin: 0 0 0.25rem 0;
}

.drop-link-notion {
    color: var(--stone-900);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.drop-hint-notion {
    font-size: 0.75rem;
    color: var(--stone-500);
    margin: 0;
}

.btn-template-notion {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--stone-900);
    cursor: pointer;
    transition: all 0.15s ease;
    align-self: flex-start;
}

.btn-template-notion:hover {
    background: var(--stone-100);
    color: var(--stone-900);
}

.btn-template-notion svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

.csv-preview-section-notion {
    padding-top: 1.5rem;
    margin-bottom: 0;
    animation: fadeIn 0.2s ease;
}

.csv-preview-title-notion {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--stone-900);
    margin: 0 0 0.75rem 0;
    letter-spacing: -0.01em;
}

.csv-preview-content-notion {
    background: white;
    border: 1px solid var(--stone-200);
    border-radius: 6px;
    padding: 0.75rem;
    max-height: 280px;
    overflow-y: auto;
    font-size: 0.8125rem;
    color: var(--stone-700);
}

.csv-preview-content-notion::-webkit-scrollbar {
    width: 6px;
}

.csv-preview-content-notion::-webkit-scrollbar-track {
    background: transparent;
}

.csv-preview-content-notion::-webkit-scrollbar-thumb {
    background: var(--stone-300);
    border-radius: 3px;
}

.csv-preview-content-notion::-webkit-scrollbar-thumb:hover {
    background: var(--stone-400);
}

.csv-preview-content-notion table {
    width: 100%;
    border-collapse: collapse;
}

.csv-preview-content-notion th {
    background: var(--stone-50);
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-weight: 500;
    color: var(--stone-700);
    border-bottom: 1px solid var(--stone-200);
    font-size: 0.75rem;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.csv-preview-content-notion td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--stone-100);
    color: var(--stone-600);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.csv-preview-content-notion tr:last-child td {
    border-bottom: none;
}

.csv-preview-content-notion tr:hover {
    background: var(--stone-50);
}

.csv-actions-notion {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-cancel-notion {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--stone-200);
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--stone-700);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-cancel-notion:hover {
    background: var(--stone-50);
    border-color: var(--stone-300);
    color: var(--stone-900);
}

.btn-primary-notion {
    padding: 0.5rem 1rem;
    background: var(--stone-900);
    border: none;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 400;
    color: white;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-primary-notion:hover {
    background: var(--stone-800);
}

.btn-primary-notion:active {
    transform: scale(0.98);
}

/* Premium Modal Header */
.modal-header-premium {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 2rem;
    background: linear-gradient(135deg, var(--stone-50) 0%, white 100%);
    border-bottom: 1px solid var(--stone-200);
}

.modal-header-content {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.modal-icon-wrapper {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--stone-900) 0%, var(--stone-800) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-icon {
    width: 26px;
    height: 26px;
    stroke: white;
}

.modal-title-group h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--stone-900);
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.modal-description {
    font-size: 0.875rem;
    color: var(--stone-500);
    margin: 0.25rem 0 0 0;
    font-weight: 400;
}

.modal-close-premium {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid var(--stone-200);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.modal-close-premium:hover {
    background: white;
    border-color: var(--stone-300);
    transform: rotate(90deg);
}

.modal-close-premium svg {
    width: 18px;
    height: 18px;
    stroke: var(--stone-600);
}

/* Premium Modal Body */
.modal-body-premium {
    padding: 2rem;
}

.upload-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Premium Drop Zone */
.drop-zone-premium {
    position: relative;
    padding: 2.5rem 2rem;
    background: linear-gradient(135deg, var(--stone-50) 0%, white 100%);
    border: 2px dashed var(--stone-300);
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.drop-zone-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(168, 162, 158, 0.05) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.drop-zone-premium:hover::before,
.drop-zone-premium.drag-over::before {
    opacity: 1;
}

.drop-zone-premium:hover,
.drop-zone-premium.drag-over {
    border-color: var(--stone-500);
    background: linear-gradient(135deg, white 0%, var(--stone-50) 100%);
    transform: translateY(-2px);
}

.drop-zone-icon-wrapper {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    background: linear-gradient(135deg, var(--stone-100) 0%, var(--stone-50) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--stone-200);
}

.drop-zone-premium:hover .drop-zone-icon-wrapper {
    transform: scale(1.05) translateY(-4px);
    background: linear-gradient(135deg, var(--stone-200) 0%, var(--stone-100) 100%);
}

.drop-zone-icon {
    width: 32px;
    height: 32px;
    stroke: var(--stone-700);
    transition: all 0.3s ease;
}

.drop-zone-premium:hover .drop-zone-icon {
    stroke: var(--stone-900);
}

.drop-zone-content {
    position: relative;
    z-index: 1;
}

.drop-zone-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--stone-900);
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.01em;
}

.drop-zone-text {
    font-size: 0.9375rem;
    color: var(--stone-600);
    margin: 0 0 0.5rem 0;
}

.drop-zone-browse {
    color: var(--stone-900);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

.drop-zone-premium:hover .drop-zone-browse {
    color: var(--stone-700);
}

.drop-zone-formats {
    font-size: 0.8125rem;
    color: var(--stone-400);
    margin: 0;
    font-weight: 500;
}

/* Premium Divider */
.divider-premium {
    display: flex;
    align-items: center;
    margin: 0.5rem 0;
    color: var(--stone-400);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.divider-premium::before,
.divider-premium::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--stone-200), transparent);
}

.divider-premium span {
    padding: 0 1rem;
}

/* Premium Input Group */
.input-group-premium {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-label-premium {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--stone-700);
    letter-spacing: -0.01em;
}

.input-label-icon {
    width: 16px;
    height: 16px;
    stroke: var(--stone-500);
}

.input-label-optional {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--stone-400);
    margin-left: auto;
}

.input-premium {
    width: 100%;
    padding: 0.875rem 1rem;
    background: white;
    border: 1px solid var(--stone-200);
    border-radius: 10px;
    font-size: 0.9375rem;
    color: var(--stone-900);
    transition: all 0.2s ease;
    font-family: inherit;
}

.input-premium:focus {
    outline: none;
    border-color: var(--stone-400);
    background: white;
}

.input-premium::placeholder {
    color: var(--stone-400);
    opacity: 1;
}

/* Premium Logo Preview */
.logo-preview-premium {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--stone-50) 0%, white 100%);
    border: 1px solid var(--stone-200);
    border-radius: 12px;
    animation: fadeIn 0.3s ease;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.preview-label-premium {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--stone-700);
    letter-spacing: -0.01em;
}

.btn-icon-premium {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: white;
    border: 1px solid var(--stone-200);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--stone-700);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon-premium:hover {
    background: white;
    border-color: var(--stone-300);
    color: var(--stone-900);
}

.btn-icon-premium svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.preview-image-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--stone-200);
}

.preview-image-wrapper img {
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
}

/* Premium Modal Footer */
.modal-footer-premium {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, white 0%, var(--stone-50) 100%);
    border-top: 1px solid var(--stone-200);
}

.btn-cancel-premium {
    padding: 0.75rem 1.5rem;
    background: white;
    border: 1px solid var(--stone-200);
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--stone-700);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel-premium:hover {
    background: white;
    border-color: var(--stone-300);
    color: var(--stone-900);
}

.btn-save-premium {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    background: linear-gradient(135deg, var(--stone-900) 0%, var(--stone-800) 100%);
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-save-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.btn-save-premium:hover::before {
    left: 100%;
}

.btn-save-premium:hover {
    transform: translateY(-2px);
}

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

.btn-save-premium .btn-icon {
    width: 18px;
    height: 18px;
    stroke: white;
}

/* CSV Import Section Premium */
.csv-import-section-premium {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.btn-template-premium {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: white;
    border: 1px solid var(--stone-200);
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--stone-700);
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: center;
    margin-top: 0.5rem;
}

.btn-template-premium:hover {
    background: var(--stone-50);
    border-color: var(--stone-300);
    color: var(--stone-900);
    transform: translateY(-1px);
}

.btn-template-premium svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.csv-preview-section-premium {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--stone-200);
    animation: fadeIn 0.3s ease;
}

.csv-preview-header {
    margin-bottom: 1.25rem;
}

.csv-preview-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--stone-900);
    margin: 0 0 0.25rem 0;
    letter-spacing: -0.01em;
}

.csv-preview-title-premium {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--stone-900);
    margin: 0 0 1.25rem 0;
    letter-spacing: -0.01em;
}

.btn-primary-premium {
    padding: 0.75rem 1.75rem;
    background: linear-gradient(135deg, var(--stone-900) 0%, var(--stone-800) 100%);
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.btn-primary-premium:hover::before {
    left: 100%;
}

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

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

/* Email Clients Section */
.email-clients-section {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--stone-200);
}

.email-clients-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--stone-600);
    margin: 0 0 1rem 0;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.email-clients-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.email-client-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 10px;
    transition: all 0.2s ease;
    cursor: default;
}

.email-client-item:hover {
    background: var(--stone-50);
}

.email-client-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: white;
    border: 1px solid var(--stone-200);
    transition: all 0.2s ease;
}

.email-client-item:hover .email-client-icon {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.email-client-icon svg {
    width: 24px;
    height: 24px;
}

.email-client-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--stone-700);
    text-align: center;
}

.csv-preview-subtitle {
    font-size: 0.875rem;
    color: var(--stone-500);
    margin: 0;
    font-weight: 400;
}

.csv-preview-content-premium {
    background: linear-gradient(135deg, var(--stone-50) 0%, white 100%);
    border: 1px solid var(--stone-200);
    border-radius: 12px;
    padding: 1.25rem;
    max-height: 320px;
    overflow-y: auto;
    font-size: 0.875rem;
    color: var(--stone-700);
}

.csv-preview-content-premium::-webkit-scrollbar {
    width: 8px;
}

.csv-preview-content-premium::-webkit-scrollbar-track {
    background: var(--stone-100);
    border-radius: 4px;
}

.csv-preview-content-premium::-webkit-scrollbar-thumb {
    background: var(--stone-300);
    border-radius: 4px;
}

.csv-preview-content-premium::-webkit-scrollbar-thumb:hover {
    background: var(--stone-400);
}

.csv-preview-content-premium table {
    width: 100%;
    border-collapse: collapse;
}

.csv-preview-content-premium th {
    background: linear-gradient(135deg, var(--stone-100) 0%, var(--stone-50) 100%);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--stone-900);
    border-bottom: 2px solid var(--stone-200);
    font-size: 0.8125rem;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.csv-preview-content-premium td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--stone-200);
    color: var(--stone-700);
}

.csv-preview-content-premium tr:last-child td {
    border-bottom: none;
}

.csv-preview-content-premium tr:hover {
    background: var(--stone-50);
}

.csv-actions-premium {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.csv-actions-premium .btn-cancel-premium {
    padding: 0.75rem 1.5rem;
    background: white;
    border: 1px solid var(--stone-200);
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--stone-700);
    cursor: pointer;
    transition: all 0.2s ease;
}

.csv-actions-premium .btn-cancel-premium:hover {
    background: white;
    border-color: var(--stone-300);
    color: var(--stone-900);
}

.csv-actions-premium .btn-save-premium {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    background: linear-gradient(135deg, var(--stone-900) 0%, var(--stone-800) 100%);
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.csv-actions-premium .btn-save-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.csv-actions-premium .btn-save-premium:hover::before {
    left: 100%;
}

.csv-actions-premium .btn-save-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(28, 25, 23, 0.15);
}

.csv-actions-premium .btn-save-premium:active {
    transform: translateY(0);
}

/* Logo Modal Styles */

.drop-zone {
    border: 2px dashed var(--stone-300);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--stone-900);
    background: white;
}

.drop-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: var(--stone-400);
}

.drop-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider span {
    padding: 0 1rem;
}

.logo-url-input,
.logo-link-input {
    margin-bottom: 1rem;
}

.logo-url-input label,
.logo-link-input label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.logo-url-input input,
.logo-link-input input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    background: white;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.logo-url-input input::placeholder,
.logo-link-input input::placeholder {
    color: var(--stone-400);
    opacity: 1;
}

.logo-url-input input:focus,
.logo-link-input input:focus {
    outline: none;
    border-color: var(--stone-300);
    background: white;
}

.logo-preview {
    margin: 1.5rem 0;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--stone-50);
    text-align: center;
}

.preview-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-weight: 500;
}

.logo-preview img {
    max-width: 200px;
    max-height: 100px;
    margin: 0 auto 1rem;
    display: block;
}

.btn-remove {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--stone-300);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-remove:hover {
    background: white;
    border-color: var(--stone-400);
    color: var(--text-primary);
}

.btn-remove .icon {
    width: 16px;
    height: 16px;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-actions .btn {
    flex: 1;
}

/* Responsive design */
@media (max-width: 1200px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .logo-upload-btn-premium {
        grid-column: span 2;
    }
}

@media (max-width: 968px) {
    .main-content {
        gap: 1rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .header h1 {
        font-size: 1.75rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
}

@media (max-width: 640px) {
    body {
        padding: 1rem 0.5rem;
    }
    
    .header h1 {
        font-size: 1.75rem;
    }
    
    .form-section,
    .preview-section {
        padding: 1.5rem;
        padding-bottom: 6rem;
    }
    
    .preview-actions {
        flex-direction: column;
        padding: 1rem;
    }
    
    .btn {
        width: 100%;
    }
    
    .modal-content {
        margin: 1rem;
    }
    
    .modal-header,
    .modal-body {
        padding: 1.5rem;
    }
}

/* Mobile message - hidden by default */
.mobile-message {
    display: none;
}

.mobile-message-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    background: var(--bg-primary);
}

.mobile-message-content .sidebar-header {
    margin-bottom: 2rem;
}

.mobile-message-text {
    font-size: 1rem;
    color: var(--text-secondary);
    text-align: center;
    max-width: 400px;
    line-height: 1.6;
}

/* Hide everything except logo on screens < 700px */
@media (max-width: 699px) {
    .container {
        display: none !important;
    }
    
    .mobile-message {
        display: block;
    }
    
    .top-actions {
        display: none !important;
    }
}

/* Progress Bar in Button */
#copyBtn {
    position: relative;
    overflow: hidden;
}

#copyBtnText {
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.btn-progress-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0 1.5rem;
    border-radius: 8px;
    z-index: 1;
}

.btn-progress-container[style*="display: flex"] {
    display: flex !important;
}

.btn-progress-container[style*="display: flex"] ~ #copyBtnText {
    opacity: 0;
    visibility: hidden;
}

.btn-progress-bar {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    max-width: 200px;
}

.btn-progress-fill {
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 2px;
    transition: width 0.3s ease-out;
    position: relative;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

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

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

.btn-progress-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    white-space: nowrap;
    min-width: 38px;
    text-align: right;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
