/**
 * CV Builder - Gelişmiş Özellikler CSS
 * Bölüm Sıralama, AI İpuçları, Referanslar, Ayarlar, Zengin Metin Editörü
 */

/* ============================================
   ZENGİN METİN EDİTÖRÜ (RICH TEXT EDITOR)
   ============================================ */
.rich-text-wrapper {
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.2s ease;
    background: var(--white);
}

.rich-text-wrapper:hover {
    border-color: var(--gray-400);
}

.rich-text-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Toolbar */
.rich-text-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 8px 12px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.toolbar-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.15s ease;
}

.toolbar-btn:hover {
    background: var(--white);
    color: var(--gray-800);
}

.toolbar-btn.active {
    background: var(--primary-100);
    color: var(--primary-700);
}

.toolbar-btn svg {
    width: 16px;
    height: 16px;
}

.toolbar-divider {
    width: 1px;
    height: 20px;
    background: var(--gray-300);
    margin: 0 6px;
}

/* Editable Area */
.rich-text-content {
    min-height: 120px;
    padding: 14px 16px;
    outline: none;
    font-size: 15px;
    line-height: 1.6;
    color: var(--gray-700);
}

.rich-text-content:empty::before {
    content: attr(data-placeholder);
    color: var(--gray-400);
    pointer-events: none;
}

.rich-text-content:focus {
    outline: none;
}

/* Rich text içerik stilleri */
.rich-text-content b,
.rich-text-content strong {
    font-weight: 600;
}

.rich-text-content i,
.rich-text-content em {
    font-style: italic;
}

.rich-text-content u {
    text-decoration: underline;
}

.rich-text-content ul,
.rich-text-content ol {
    margin: 8px 0;
    padding-left: 24px;
}

.rich-text-content ul {
    list-style-type: disc;
}

.rich-text-content ol {
    list-style-type: decimal;
}

.rich-text-content li {
    margin: 4px 0;
    display: list-item;
}

/* Hidden textarea for form submission */
.rich-text-hidden {
    display: none !important;
}

/* ============================================
   BÖLÜM SIRALAMA (DRAG & DROP)
   ============================================ */
.cv-form-section {
    position: relative;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.cv-form-section.dragging {
    opacity: 0.5;
    border: 2px dashed var(--primary);
    background: var(--primary-50);
}

.cv-form-section.drag-over {
    border: 2px dashed var(--success);
    background: rgba(16, 185, 129, 0.05);
}

/* Section Header - Yeni Tasarım */
.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid var(--gray-200);
    margin: -20px -20px 20px -20px;
}

/* Sürükle-bırak tutamacını gizle - sadece oklar kullanılacak */
.section-drag-handle {
    display: none;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.section-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border-radius: 10px;
    font-size: 18px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.section-title-text {
    font-weight: 600;
    font-size: 16px;
    color: var(--gray-800);
}

.section-title-text.editable {
    cursor: text;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.section-title-text.editable:hover {
    background: var(--white);
}

/* ============================================
   AI İPUÇLARI
   ============================================ */
.ai-tips-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #92400e;
    cursor: pointer;
    transition: all 0.2s;
}

.ai-tips-btn:hover {
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.ai-tips-btn svg {
    width: 16px;
    height: 16px;
}

/* Tips Popup */
.tips-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.tips-popup.active {
    opacity: 1;
    visibility: visible;
}

.tips-popup-content {
    background: var(--white);
    border-radius: 16px;
    max-width: 480px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.tips-popup.active .tips-popup-content {
    transform: scale(1) translateY(0);
}

.tips-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-bottom: 1px solid #f59e0b;
}

.tips-popup-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: #92400e;
    margin: 0;
}

.tips-popup-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #92400e;
    transition: all 0.2s;
}

.tips-popup-close:hover {
    background: var(--white);
}

.tips-popup-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

.tip-item {
    display: flex;
    gap: 14px;
    padding: 16px;
    background: #fffbeb;
    border-radius: 12px;
    margin-bottom: 12px;
    border-left: 4px solid #f59e0b;
}

.tip-item:last-child {
    margin-bottom: 0;
}

.tip-number {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f59e0b;
    color: white;
    font-size: 14px;
    font-weight: 600;
    border-radius: 50%;
    flex-shrink: 0;
}

.tip-text {
    font-size: 14px;
    line-height: 1.6;
    color: #78350f;
}

/* ============================================
   BÖLÜM AYARLARI POPUP
   ============================================ */
.section-settings-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.section-settings-popup.active {
    opacity: 1;
    visibility: visible;
}

.settings-popup-content {
    background: var(--white);
    border-radius: 16px;
    max-width: 420px;
    width: 90%;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.section-settings-popup.active .settings-popup-content {
    transform: scale(1) translateY(0);
}

.settings-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
}

.settings-popup-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.settings-popup-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: var(--gray-500);
    transition: all 0.2s;
}

.settings-popup-close:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.settings-popup-body {
    padding: 24px;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-item label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.setting-item .setting-desc {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 10px;
}

.setting-item input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.2s;
}

.setting-item input[type="text"]:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Toggle Switch */
.toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--gray-50);
    border-radius: 12px;
    margin-bottom: 12px;
}

.toggle-wrapper:last-child {
    margin-bottom: 0;
}

.toggle-info {
    flex: 1;
}

.toggle-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 2px;
}

.toggle-desc {
    font-size: 12px;
    color: var(--gray-500);
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    background: var(--gray-300);
    border-radius: 13px;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-switch.active {
    background: var(--primary);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch.active::after {
    transform: translateX(22px);
}

/* ============================================
   REFERANSLAR BÖLÜMÜ
   ============================================ */
.reference-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    border: 1px solid #0ea5e9;
    border-radius: 12px;
    margin-bottom: 20px;
}

.reference-toggle-wrapper .toggle-switch {
    background: var(--gray-300);
}

.reference-toggle-wrapper .toggle-switch.active {
    background: #0ea5e9;
}

.reference-toggle-text {
    flex: 1;
}

.reference-toggle-text strong {
    display: block;
    font-size: 14px;
    color: #0c4a6e;
    margin-bottom: 2px;
}

.reference-toggle-text span {
    font-size: 13px;
    color: #0369a1;
}

.reference-item {
    background: var(--gray-50);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--gray-200);
    position: relative;
}

.reference-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-200);
}

.reference-item-title {
    font-weight: 600;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 8px;
}

.reference-item-actions {
    display: flex;
    gap: 8px;
}

/* ============================================
   ITEM CONTROLS (Sil, Kaydet, İpuçları)
   ============================================ */
.item-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
}

.item-controls-left {
    display: flex;
    gap: 8px;
}

.item-controls-right {
    display: flex;
    gap: 8px;
}

.btn-item-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.btn-item-delete {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.btn-item-delete:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

.btn-item-clear {
    background: #fffbeb;
    color: #d97706;
    border-color: #fde68a;
}

.btn-item-clear:hover {
    background: #fef3c7;
    border-color: #fcd34d;
}

.btn-item-save {
    background: var(--primary-50);
    color: var(--primary);
    border-color: var(--primary-200);
}

.btn-item-save:hover {
    background: var(--primary-100);
}

/* ============================================
   YENİ ÖĞELER EKLEME BUTONU
   ============================================ */
.btn-add-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px;
    background: var(--white);
    border: 2px dashed var(--gray-300);
    border-radius: 12px;
    color: var(--gray-500);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 16px;
}

.btn-add-item:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-50);
}

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

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .section-header {
        flex-wrap: wrap;
        gap: 10px;
        padding: 14px 16px;
        margin: -16px -16px 16px -16px;
    }
    
    .item-controls {
        flex-direction: column;
        gap: 12px;
    }
    
    .item-controls-left,
    .item-controls-right {
        width: 100%;
        justify-content: center;
    }
    
    .tips-popup-content,
    .settings-popup-content {
        width: 95%;
        margin: 20px;
    }
}

/* Küçük mobil cihazlar */
@media (max-width: 480px) {
    .section-header {
        padding: 12px 14px;
    }
    
    .section-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .section-title-text {
        font-size: 14px;
    }
}

/* ============================================
   KARAKTER SAYACI STİLLERİ
   ============================================ */
.char-counter {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 8px 8px;
    transition: all 0.3s ease;
}

.char-counter.green {
    color: #059669;
    background: #ecfdf5;
}

.char-counter.yellow {
    color: #d97706;
    background: #fffbeb;
}

.char-counter.orange {
    color: #ea580c;
    background: #fff7ed;
}

.char-counter.red {
    color: #dc2626;
    background: #fef2f2;
}

.char-counter.exceeded {
    color: #fff;
    background: #dc2626;
    animation: pulse-red 1s infinite;
}

.char-counter .char-current {
    font-weight: 700;
}

.char-counter .char-max {
    color: inherit;
    opacity: 0.7;
}

@keyframes pulse-red {
    0%, 100% { background: #dc2626; }
    50% { background: #b91c1c; }
}

/* Input alanları için karakter sayacı */
.input-with-counter {
    position: relative;
}

.input-with-counter .input-counter {
    position: absolute;
    right: 12px;
    bottom: 8px;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
    transition: all 0.3s ease;
}

.input-with-counter .input-counter.green {
    color: #059669;
    background: rgba(5, 150, 105, 0.1);
}

.input-with-counter .input-counter.yellow {
    color: #d97706;
    background: rgba(217, 119, 6, 0.1);
}

.input-with-counter .input-counter.orange {
    color: #ea580c;
    background: rgba(234, 88, 12, 0.1);
}

.input-with-counter .input-counter.red {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}

.input-with-counter input,
.input-with-counter textarea {
    padding-right: 70px;
}

/* Mobil uyumluluk */
@media (max-width: 640px) {
    .char-counter {
        font-size: 11px;
        padding: 4px 10px;
    }
}

/* ============================================
   LİMİT UYARI TOAST
   ============================================ */
.limit-warning-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.25);
    z-index: 10000;
    animation: slideUp 0.3s ease;
}

.limit-warning-toast svg {
    color: #d97706;
    flex-shrink: 0;
}

.limit-warning-toast span {
    color: #92400e;
    font-size: 14px;
    font-weight: 500;
}

.limit-warning-toast.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

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

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

/* Disabled buton stili */
.btn-add-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Mobil uyumluluk */
@media (max-width: 640px) {
    .limit-warning-toast {
        left: 16px;
        right: 16px;
        transform: none;
        bottom: 16px;
    }
    
    .limit-warning-toast span {
        font-size: 13px;
    }
}

/* ============================================
   ALAN LİMİT BİLGİ METNİ
   ============================================ */
.field-limit-info {
    font-size: 12px;
    color: #6b7280;
    margin: 8px 0 12px 0;
    padding-left: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.field-limit-info::before {
    content: "ℹ️";
    font-size: 11px;
}

/* ============================================
   TELEFON BAYRAK SEÇİCİ
   ============================================ */
.phone-input-wrapper {
    display: flex;
    position: relative;
}

.country-select {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    height: 48px;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-right: none;
    border-radius: 12px 0 0 12px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 100px;
    user-select: none;
}

.country-select:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.country-flag {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 18px;
}

.country-flag img {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.country-code {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
}

.dropdown-arrow {
    color: var(--gray-400);
    transition: transform 0.2s;
    margin-left: auto;
}

.country-select.active .dropdown-arrow {
    transform: rotate(180deg);
}

.phone-number-input {
    border: 2px solid var(--gray-200) !important;
    border-left: none !important;
    border-radius: 0 12px 12px 0 !important;
    height: 48px !important;
    flex: 1;
    padding: 0 16px !important;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.phone-number-input:focus {
    border-color: var(--primary-500) !important;
    box-shadow: none !important;
    outline: none;
}

.phone-input-wrapper:focus-within .country-select {
    border-color: var(--primary-500);
}

/* Hata durumu */
.phone-input-wrapper.has-error .country-select {
    border-color: #dc2626;
}

.phone-input-wrapper.has-error .phone-number-input {
    border-color: #dc2626 !important;
}

.phone-error {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    font-size: 12px;
    color: #dc2626;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.phone-error::before {
    content: "⚠";
    font-size: 11px;
}

/* Başarılı durumu */
.phone-input-wrapper.is-valid .country-select {
    border-color: #16a34a;
}

.phone-input-wrapper.is-valid .phone-number-input {
    border-color: #16a34a !important;
}

.country-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 280px;
    max-height: 320px;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.country-dropdown.active {
    display: block;
    animation: dropdownFadeIn 0.2s ease;
}

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

.country-search {
    padding: 10px;
    border-bottom: 1px solid var(--gray-100);
}

.country-search input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.country-search input:focus {
    border-color: var(--primary-500);
}

.country-list {
    max-height: 250px;
    overflow-y: auto;
}

.country-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.country-item:hover {
    background: var(--gray-50);
}

.country-item.selected {
    background: var(--primary-50);
}

.country-item-flag {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
}

.country-item-flag img {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.country-item-name {
    flex: 1;
    font-size: 14px;
    color: var(--gray-700);
}

.country-item-code {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 500;
}

/* Mobil uyumluluk */
@media (max-width: 640px) {
    .country-select {
        min-width: 85px;
        padding: 0 8px;
    }
    
    .country-code {
        font-size: 13px;
    }
    
    .country-dropdown {
        width: calc(100vw - 32px);
        max-width: 320px;
    }
}

/* =============================================
   REFERANS TELEFON STİLLERİ
   ============================================= */

.ref-phone-wrapper {
    display: flex;
    position: relative;
}

.ref-country-select {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    height: 48px;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-right: none;
    border-radius: 12px 0 0 12px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 90px;
    user-select: none;
}

.ref-country-select:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.ref-flag-img {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.ref-code-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
}

.ref-dropdown-arrow {
    color: var(--gray-400);
    transition: transform 0.2s;
    margin-left: 2px;
}

.ref-phone-input {
    border: 2px solid var(--gray-200) !important;
    border-left: none !important;
    border-radius: 0 12px 12px 0 !important;
    height: 48px !important;
    flex: 1;
    padding: 0 14px !important;
    font-size: 14px;
    transition: border-color 0.2s;
}

.ref-phone-input:focus {
    border-color: var(--primary-500) !important;
    outline: none;
}

.ref-phone-wrapper:focus-within .ref-country-select {
    border-color: var(--primary-500);
}

.ref-country-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 260px;
    max-height: 280px;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.ref-country-dropdown.show {
    display: block;
    animation: refDropdownFadeIn 0.2s ease;
}

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

.ref-country-search {
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
    outline: none;
}

.ref-country-search:focus {
    background: var(--gray-50);
}

.ref-country-list {
    max-height: 220px;
    overflow-y: auto;
}

.ref-country-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.ref-country-option:hover {
    background: var(--gray-50);
}

.ref-country-option img {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.ref-country-name {
    flex: 1;
    font-size: 13px;
    color: var(--gray-700);
}

.ref-country-code-text {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 500;
}

/* Mobil uyumluluk - Referans telefon */
@media (max-width: 640px) {
    .ref-country-select {
        min-width: 80px;
        padding: 0 8px;
    }
    
    .ref-code-text {
        font-size: 12px;
    }
    
    .ref-country-dropdown {
        width: calc(100vw - 48px);
        max-width: 280px;
    }
}
