/* 알림 설정 버튼 */
.notification-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 1000;
    transition: all 0.3s ease;
}

.notification-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.notification-btn.has-alert {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(102, 126, 234, 0); }
    100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0); }
}

/* 알림 설정 모달 */
.notification-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.notification-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-modal-content {
    background: linear-gradient(135deg, #1e1e2e 0%, #2a2a3e 100%);
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

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

.notification-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
}

.notification-modal-title {
    font-size: 24px;
    font-weight: bold;
}

.notification-modal-title span {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.notification-close-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 28px;
    cursor: pointer;
    transition: color 0.3s;
}

.notification-close-btn:hover {
    color: #ff6b6b;
}

/* 권한 요청 섹션 */
.permission-section {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.permission-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.permission-status-icon {
    font-size: 20px;
}

.permission-request-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.permission-request-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

/* 메인 토글 */
.main-toggle-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toggle-label {
    font-size: 18px;
    font-weight: 500;
}

.toggle-switch {
    position: relative;
    width: 60px;
    height: 30px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #444;
    transition: .4s;
    border-radius: 30px;
}

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

input:checked + .toggle-slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

/* 알림 모드 선택 */
.alert-mode-section {
    margin-bottom: 25px;
}

.section-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 15px;
    color: #ccc;
}

.alert-mode-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.mode-option {
    position: relative;
}

.mode-option input {
    display: none;
}

.mode-option label {
    display: block;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.mode-option input:checked + label {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.mode-option label:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 개별 코인 설정 */
.individual-coin-settings {
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 15px;
}

.coin-settings-table {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.coin-settings-header {
    display: grid;
    grid-template-columns: 100px 1fr 1fr 60px;
    gap: 15px;
    padding: 12px 15px;
    background: rgba(102, 126, 234, 0.2);
    font-size: 13px;
    font-weight: 500;
    color: #aaa;
    text-align: center;
}

.coin-settings-header > *:first-child {
    text-align: left;
}

.coin-settings-list {
    max-height: 300px;
    overflow-y: auto;
}

.coin-settings-item {
    display: grid;
    grid-template-columns: 100px 1fr 1fr 60px;
    gap: 15px;
    padding: 10px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    align-items: center;
}

.coin-settings-item > *:last-child {
    justify-self: center;
}

.coin-settings-item:last-child {
    border-bottom: none;
}

.coin-settings-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.coin-ticker {
    font-weight: 500;
    color: #ddd;
    display: flex;
    align-items: center;
    gap: 5px;
}

.coin-ticker img {
    width: 20px;
    height: 20px;
}

.coin-threshold-input {
    width: 100%;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    color: #fff;
    font-size: 13px;
    text-align: center;
}

.coin-threshold-input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.15);
}

.coin-threshold-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.coin-enable-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

.coin-settings-help {
    font-size: 12px;
    color: #888;
    margin-top: 10px;
}

.coin-settings-empty {
    padding: 30px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* 거래소 선택 */
.exchange-select-section {
    margin-bottom: 25px;
}

.exchange-select-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.exchange-option {
    position: relative;
}

.exchange-option input {
    display: none;
}

.exchange-option label {
    display: block;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.exchange-option input:checked + label {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.exchange-option label:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 임계값 설정 */
.threshold-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.threshold-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 15px;
}

.threshold-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.threshold-label {
    font-size: 14px;
    color: #aaa;
}

.threshold-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.threshold-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    color: white;
    width: 100px;
    font-size: 16px;
}

.threshold-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.threshold-unit {
    color: #888;
    font-size: 14px;
}


/* 추가 설정 */
.additional-settings {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

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

.setting-label {
    font-size: 14px;
    color: #ccc;
}

/* 알림 히스토리 */
.history-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid rgba(102, 126, 234, 0.3);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.clear-history-btn {
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid #ff6b6b;
    color: #ff6b6b;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.clear-history-btn:hover {
    background: rgba(255, 107, 107, 0.3);
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 10px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
}

.history-item:last-child {
    border-bottom: none;
}

.history-coin {
    font-weight: bold;
    color: #667eea;
}

.history-premium {
    color: #4ade80;
}

.history-premium.negative {
    color: #ff6b6b;
}

.history-time {
    color: #888;
    font-size: 12px;
}

/* 테스트 알림 버튼 */
.test-notification-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    width: 100%;
    margin-top: 20px;
}

.test-notification-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(240, 147, 251, 0.4);
}

/* 반응형 */
@media (max-width: 768px) {
    .notification-modal-content {
        width: 95%;
        padding: 20px;
    }
    
    .alert-mode-options {
        grid-template-columns: 1fr;
    }
    
    .threshold-controls {
        grid-template-columns: 1fr;
    }
}