/**
 * 주식 자동매매 시스템 Premium Glassmorphism 디자인 시스템
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

:root {
    --font-primary: 'Outfit', 'Noto Sans KR', sans-serif;
    
    /* Sleek & Premium Color System */
    --color-bg-raw: 15, 23, 42; /* slate-900 */
    --color-bg: rgb(var(--color-bg-raw));
    --color-card-raw: 30, 41, 59; /* slate-800 */
    --color-card: rgba(var(--color-card-raw), 0.7);
    --color-card-border: rgba(255, 255, 255, 0.08);
    
    --color-accent-blue: #3b82f6;
    --color-accent-purple: #8b5cf6;
    --color-accent-gradient: linear-gradient(135deg, var(--color-accent-blue), var(--color-accent-purple));
    
    --color-text-primary: #f8fafc;
    --color-text-muted: #94a3b8;
    
    --color-success: #10b981;
    --color-danger: #ef4444;
    --color-warning: #f59e0b;
    --color-info: #06b6d4;

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --backdrop-blur-val: blur(16px);
}

body {
    background-color: var(--color-bg);
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
}

/* Glassmorphism Card Style */
.glass-card {
    background: var(--color-card);
    backdrop-filter: var(--backdrop-blur-val);
    -webkit-backdrop-filter: var(--backdrop-blur-val);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: var(--transition-smooth);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

/* Premium Navigation Bar */
.navbar-glass {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: var(--backdrop-blur-val);
    -webkit-backdrop-filter: var(--backdrop-blur-val);
    border-bottom: 1px solid var(--color-card-border);
    padding: 1rem 1.5rem;
}

.navbar-brand-gradient {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
    background: var(--color-accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-link-custom {
    color: var(--color-text-muted) !important;
    font-weight: 500;
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem !important;
    transition: var(--transition-smooth);
}

.nav-link-custom:hover, .nav-link-custom.active {
    color: var(--color-text-primary) !important;
    background: rgba(255, 255, 255, 0.05);
}

/* Premium Buttons */
.btn-premium {
    background: var(--color-accent-gradient);
    border: none;
    color: white;
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.5rem;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.btn-premium::after {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
    transition: 0.75s;
    opacity: 0;
}

.btn-premium:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
    color: white;
}

.btn-premium:hover::after {
    left: 125%;
    opacity: 1;
}

/* Status Badges */
.badge-status {
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 700;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.badge-status-running {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-status-stopped {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Form Inputs */
.form-control-glass {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--color-card-border);
    color: var(--color-text-primary) !important;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    transition: var(--transition-smooth);
}

.form-control-glass:focus {
    background: rgba(15, 23, 42, 0.8);
    border-color: var(--color-accent-blue);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.25);
    outline: none;
}

/* Custom Table Style */
.table-glass {
    color: var(--color-text-primary) !important;
    background-color: transparent !important;
    --bs-table-bg: transparent !important;
    --bs-table-color: var(--color-text-primary) !important;
    margin-bottom: 0;
}

.table-glass th {
    font-weight: 600;
    color: var(--color-text-muted) !important;
    background-color: transparent !important;
    border-bottom: 2px solid var(--color-card-border) !important;
    padding: 1rem;
}

.table-glass td {
    padding: 1rem;
    color: var(--color-text-primary) !important;
    background-color: transparent !important;
    border-bottom: 1px solid var(--color-card-border);
    vertical-align: middle;
}

.table-glass tbody tr {
    transition: var(--transition-smooth);
    background-color: transparent !important;
}

.table-glass tbody tr:hover {
    background: rgba(255, 255, 255, 0.02) !important;
}

/* Dynamic Text Colors */
.text-profit {
    color: var(--color-success);
    font-weight: 600;
}

.text-loss {
    color: var(--color-danger);
    font-weight: 600;
}

/* Auth Pages Layout */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    padding: 2.5rem;
}

/* Custom Toggle Switch */
.form-switch-premium .form-check-input {
    width: 2.5em;
    height: 1.25em;
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.form-switch-premium .form-check-input:checked {
    background-color: var(--color-accent-blue);
    border-color: var(--color-accent-blue);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

/* Micro-animations */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.pulse-active {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--color-success);
    border-radius: 50%;
    margin-right: 6px;
    box-shadow: 0 0 10px var(--color-success);
    animation: pulse 2s infinite ease-in-out;
}

.pulse-inactive {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--color-danger);
    border-radius: 50%;
    margin-right: 6px;
    box-shadow: 0 0 5px var(--color-danger);
}

/* Bootstrap text-muted 오버라이드 (가시성 확보) */
.text-muted {
    color: var(--color-text-muted) !important;
}

/* Input Group 및 아이콘 스타일 최적화 */
.input-group-text {
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid var(--color-card-border) !important;
    border-right: none !important;
    color: var(--color-text-muted) !important;
    padding-left: 1.1rem;
    padding-right: 0.75rem;
}

.input-group-text i {
    color: #f8fafc !important; /* 아이콘을 아주 밝은 흰색으로 고정 */
    font-size: 1.15rem;
    opacity: 0.9;
}

.input-group > .form-control-glass {
    border-left: none !important;
}

/* 입력 필드 그룹에 포커스가 갔을 때 일체감 있게 파란색 보더 및 광원 효과 부여 */
.input-group:focus-within .input-group-text {
    border-color: var(--color-accent-blue) !important;
    background: rgba(15, 23, 42, 0.8) !important;
}

.input-group:focus-within .form-control-glass {
    border-color: var(--color-accent-blue) !important;
    background: rgba(15, 23, 42, 0.8) !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.25);
}

/* Placeholder (홀더 글씨) 가시성 확보 */
.form-control-glass::placeholder {
    color: rgba(255, 255, 255, 0.35) !important;
    opacity: 1 !important;
}

.form-control-glass::-webkit-input-placeholder {
    color: rgba(255, 255, 255, 0.35) !important;
    opacity: 1 !important;
}

.form-control-glass:-ms-input-placeholder {
    color: rgba(255, 255, 255, 0.35) !important;
    opacity: 1 !important;
}
/* Modal Custom Buttons */
.btn-modal-confirm, .btn-modal-cancel {
    height: 38px;
    padding: 0 24px;
    border-radius: 19px; /* 알약 형태 */
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
}

.btn-modal-confirm {
    background: var(--color-accent-gradient);
    color: white !important;
    border: none;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.btn-modal-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.35);
}

.btn-modal-cancel {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-muted) !important;
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-modal-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text-primary) !important;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}
