/**
 * Yoga Flow — Searchable Country Code Selector Styles
 * Location: /yoga1/assets/css/searchable_country_select.css
 * Time Zone: Indian Standard Time (Asia/Kolkata +05:30)
 */

.sc-container {
    position: relative;
    width: 100%;
    font-family: inherit;
    user-select: none;
}

/* Trigger Button */
.sc-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.625rem 0.875rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 0.8125rem;
    line-height: 1.25rem;
    font-weight: 600;
    text-align: left;
    outline: none;
}

/* Light Theme */
.sc-theme-light .sc-trigger {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
}

.sc-theme-light .sc-trigger:hover,
.sc-theme-light .sc-trigger:focus-visible,
.sc-theme-light.sc-open .sc-trigger {
    background-color: #ffffff;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Dark Theme */
.sc-theme-dark .sc-trigger {
    background-color: #020617;
    border: 1px solid #334155;
    color: #f8fafc;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
}

.sc-theme-dark .sc-trigger:hover,
.sc-theme-dark .sc-trigger:focus-visible,
.sc-theme-dark.sc-open .sc-trigger {
    background-color: #0f172a;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.sc-trigger-content {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
    flex: 1;
}

.sc-flag {
    font-size: 1.25rem;
    line-height: 1;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sc-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}

.sc-code-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.025em;
    flex-shrink: 0;
}

.sc-theme-light .sc-code-badge {
    background-color: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.sc-theme-dark .sc-code-badge {
    background-color: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.sc-arrow {
    margin-left: 0.5rem;
    font-size: 0.75rem;
    opacity: 0.6;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.sc-open .sc-arrow {
    transform: rotate(180deg);
}

/* Dropdown Panel */
.sc-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 99999;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 20px 35px -5px rgba(0, 0, 0, 0.25), 0 10px 15px -5px rgba(0, 0, 0, 0.15);
    display: none;
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    transition: opacity 0.15s ease, transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(16px);
}

.sc-open .sc-dropdown {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.sc-theme-light .sc-dropdown {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
}

.sc-theme-dark .sc-dropdown {
    background-color: #0f172a;
    border: 1px solid #334155;
}

/* Search Header */
.sc-search-wrapper {
    position: relative;
    padding: 0.75rem;
    border-bottom-width: 1px;
    border-bottom-style: solid;
}

.sc-theme-light .sc-search-wrapper {
    border-bottom-color: #f1f5f9;
    background-color: #f8fafc;
}

.sc-theme-dark .sc-search-wrapper {
    border-bottom-color: #1e293b;
    background-color: #020617;
}

.sc-search-icon {
    position: absolute;
    left: 1.35rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8125rem;
    color: #64748b;
    pointer-events: none;
}

.sc-search-input {
    width: 100%;
    padding: 0.625rem 2rem 0.625rem 2.25rem;
    border-radius: 0.625rem;
    font-size: 0.8125rem;
    font-weight: 600;
    outline: none;
    transition: all 0.15s ease;
    border-width: 1px;
    border-style: solid;
}

.sc-theme-light .sc-search-input {
    background-color: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

.sc-theme-light .sc-search-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

.sc-theme-dark .sc-search-input {
    background-color: #0b1329;
    border-color: #334155;
    color: #f8fafc;
}

.sc-theme-dark .sc-search-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.sc-search-clear {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.8125rem;
    display: none;
    line-height: 1;
}

.sc-search-clear:hover {
    color: #ef4444;
}

/* Search Meta Stats */
.sc-search-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0.875rem 0;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sc-theme-light .sc-search-meta {
    color: #64748b;
}

.sc-theme-dark .sc-search-meta {
    color: #94a3b8;
}

/* List of Countries */
.sc-list {
    max-height: 260px;
    overflow-y: auto;
    padding: 0.375rem;
    margin: 0;
    list-style: none;
    scroll-behavior: smooth;
}

.sc-list::-webkit-scrollbar {
    width: 6px;
}

.sc-theme-light .sc-list::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 4px;
}

.sc-theme-dark .sc-list::-webkit-scrollbar-thumb {
    background-color: #334155;
    border-radius: 4px;
}

/* Item */
.sc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.8125rem;
    transition: all 0.1s ease;
    gap: 0.5rem;
}

.sc-theme-light .sc-item {
    color: #1e293b;
}

.sc-theme-light .sc-item:hover,
.sc-theme-light .sc-item.sc-focused {
    background-color: #f1f5f9;
    color: #0f172a;
}

.sc-theme-light .sc-item.sc-selected {
    background-color: #ecfdf5;
    color: #065f46;
    font-weight: 700;
}

.sc-theme-dark .sc-item {
    color: #e2e8f0;
}

.sc-theme-dark .sc-item:hover,
.sc-theme-dark .sc-item.sc-focused {
    background-color: #1e293b;
    color: #ffffff;
}

.sc-theme-dark .sc-item.sc-selected {
    background-color: rgba(16, 185, 129, 0.18);
    color: #6ee7b7;
    font-weight: 700;
}

.sc-item-left {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
    flex: 1;
}

.sc-item-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sc-item-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.sc-iso-badge {
    font-size: 0.6875rem;
    font-weight: 800;
    opacity: 0.6;
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
}

.sc-theme-light .sc-iso-badge {
    background-color: #e2e8f0;
    color: #475569;
}

.sc-theme-dark .sc-iso-badge {
    background-color: #334155;
    color: #cbd5e1;
}

.sc-match-highlight {
    background-color: #fef08a;
    color: #854d0e;
    padding: 0 0.15rem;
    border-radius: 0.2rem;
    font-weight: 800;
}

.sc-theme-dark .sc-match-highlight {
    background-color: #854d0e;
    color: #fef08a;
}

.sc-empty-state {
    padding: 1.5rem 1rem;
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 600;
}

.sc-theme-light .sc-empty-state {
    color: #64748b;
}

.sc-theme-dark .sc-empty-state {
    color: #94a3b8;
}
