:root {
    --bg-color: #050505;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-color: #3b82f6;
    --up-color: #ef4444;
    --down-color: #3b82f6;
    --glass-blur: 15px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    filter: blur(80px);
    opacity: 0.4;
}

.blob {
    position: absolute;
    border-radius: 50%;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #1e3a8a;
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: #7e22ce;
    bottom: 10%;
    right: -50px;
}

.blob-3 {
    width: 250px;
    height: 250px;
    background: #1d4ed8;
    top: 40%;
    left: 30%;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Glass Effect */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: 20px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.settings-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--up-color);
    color: var(--up-color);
}

.api-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    padding: 6px 12px;
    border-radius: 10px;
}

.api-selector i {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.api-selector select {
    background: transparent;
    border: none;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
}

.api-selector select option {
    background: #1a1a1a;
    color: white;
}

/* Modal select options fix */
#global-settings-modal select option {
    background: #1a1a1a;
    color: white;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo i {
    font-size: 2rem;
    color: var(--accent-color);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
}

.pulse {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Stats Grid (Removed) */
/* .stats-grid, .stat-card 관련 스타일 삭제됨 */

/* Coin List Section */
.coin-list-section {
    padding: 1.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.search-box {
    position: relative;
    width: 250px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-box input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 10px 10px 10px 35px;
    color: white;
    outline: none;
    transition: all 0.3s ease;
}

.search-box input:focus {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.08);
}

/* Table */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 400;
    padding: 1rem;
    border-bottom: 1px solid var(--card-border);
}

th.sortable {
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

th.sortable:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

th.sortable i {
    margin-left: 5px;
    font-size: 0.75rem;
    opacity: 0.5;
}

th.sortable.active {
    color: var(--accent-color);
    font-weight: 600;
}

th.sortable.active i {
    opacity: 1;
}

td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--card-border);
    font-size: 0.95rem;
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

.coin-name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.coin-symbol {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.up {
    color: var(--up-color);
}

.down {
    color: var(--down-color);
}

/* Alarm Button */
.alert-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.alert-btn.active {
    background: var(--accent-gradient);
    color: white;
    border: none;
    box-shadow: var(--accent-glow);
}

.alert-btn.active {
    background: rgba(245, 158, 11, 0.1);
    border-color: #f59e0b;
    color: #f59e0b;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    width: 90%;
    max-width: 400px;
    padding: 2rem;
    position: relative;
}

.modal-content h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

#modal-coin-name {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.input-group input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    padding: 12px;
    border-radius: 10px;
    color: white;
    outline: none;
    font-size: 1rem;
}

.input-group input:focus {
    border-color: var(--accent-color);
}

.modal-footer {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* New: Alarm Price Indicators in Price Cell */
.price-cell-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
}

.target-price-indicator {
    font-size: 0.75rem;
    font-weight: 600;
}

.target-price-indicator.above {
    color: #f59e0b;
    margin-bottom: 4px;
}

.target-price-indicator.below {
    color: #f59e0b;
    margin-top: 4px;
}

/* Favorite Button */
.fav-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.1);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fav-btn:hover {
    color: rgba(255, 255, 255, 0.3);
}

.fav-btn.active {
    color: #eab308;
    /* Star Gold */
}

/* Toggle Switch Styling */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

/* Toggle Switch Styling */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 22px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #10b981;
    /* Green color for Active */
}

input:checked+.slider:before {
    transform: translateX(22px);
}

/* Footer */
footer {
    margin-top: 3rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Patch Note Items */
.patch-item {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.patch-item:last-child {
    border-bottom: none;
}

.patch-version {
    color: var(--accent-color);
    font-weight: bold;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 4px;
}

.patch-date {
    color: var(--text-secondary);
    font-size: 0.75rem;
    display: block;
    margin-bottom: 8px;
}

.patch-changes {
    margin: 0;
    padding-left: 18px;
    list-style-type: disc;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.patch-changes li {
    margin-bottom: 5px;
}

/* Info Button (Glassmorphism Styled to match API Selector) */
.info-btn.text-btn {
    background: rgba(255, 255, 255, 0.05);
    /* 사이트 배경과 조화되는 반투명 */
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 6px 15px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-family: 'Inter', sans-serif;
    /* 폰트 일관성 확보 */
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    /* API 선택기와 높이 맞춤 */
}

.info-btn.text-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.info-btn.text-btn:active {
    transform: translateY(0);
}

.kakao-link-btn:hover {
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .search-box {
        width: 100%;
    }
}