/* ===== 기본 스타일 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

/* ===== 컨테이너 ===== */
.bot-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ===== 페이지 헤더 ===== */
.page-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.back-arrow {
    font-size: 1.5rem;
    color: #667eea;
    text-decoration: none;
    padding: 5px;
    transition: transform 0.2s ease;
}

.back-arrow:hover {
    transform: translateX(-3px);
}

.page-title {
    text-align: center;
}

.page-title h1 {
    margin: 0;
    font-size: 1.2rem;
    color: #667eea;
    font-weight: 600;
}

/* ===== 카드 섹션 ===== */
.card-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    padding-left: 10px;
}

/* ===== 메뉴 그리드 (index.html용) ===== */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.menu-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.menu-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.menu-card-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.menu-card-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 10px;
}

.menu-card-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

/* ===== 시스템 정보 카드 (index.html용) ===== */
.info-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.info-item {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.info-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
}

.info-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #667eea;
}

/* ===== 스케줄 카드 (bot_info.html용) ===== */
.schedule-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.schedule-field-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.schedule-field {
    display: flex;
    flex-direction: column;
}

.schedule-field label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
}

.schedule-field input {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
}

.schedule-field input:focus {
    outline: none;
    border-color: #667eea;
}

.schedule-field-checkbox {
    align-items: center;
}

.schedule-actions {
    display: flex;
    justify-content: flex-end;
}

/* ===== 봇 카드 (bot_info.html용) ===== */
.bot-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.bot-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.bot-card.new-entry {
    border: 2px dashed #667eea;
    background: #f0f4ff;
}

.bot-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #667eea;
}

.bot-header-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bot-card-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.bot-field-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.bot-field {
    display: flex;
    flex-direction: column;
}

.bot-field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 6px;
}

.bot-field input {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.bot-field input:focus {
    outline: none;
    border-color: #667eea;
}

.bot-field input:disabled {
    background-color: #f5f5f5;
    color: #999;
}

.bot-field-checkbox {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.bot-field-radio {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
}

.radio-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.radio-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}

.bot-card-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 10px;
}

/* ===== 티커 그룹 (bot_info.html용) ===== */
.ticker-group-header {
    background: white;
    color: #333;
    border: none;
    border-left: 4px solid #667eea;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.ticker-group-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-left-color: #5568d3;
}

.ticker-toggle {
    font-size: 1.2rem;
    color: #667eea;
}

.ticker-name {
    font-size: 1.1rem;
    color: #333;
    font-weight: 700;
}

.ticker-count {
    margin-left: auto;
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.ticker-group-content {
    padding-left: 0;
    margin-bottom: 20px;
}

/* ===== Status 카드 (status.html용) ===== */
.status-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 20px;
}

.status-section {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.status-section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 15px;
    text-align: center;
}

.status-field-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.status-field {
    display: flex;
    flex-direction: column;
}

.status-field label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 6px;
}

.status-field input {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
}

.status-field input:focus {
    outline: none;
    border-color: #667eea;
}

.status-actions {
    display: flex;
    justify-content: flex-end;
}

/* ===== 텔레그램 카드 (status.html용) ===== */
.telegram-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.telegram-button-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.btn-telegram {
    padding: 15px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-telegram:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* ===== 버튼 스타일 ===== */
.btn-primary {
    padding: 10px 20px;
    background-color: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    background-color: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-success {
    padding: 10px 20px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-success:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-danger {
    padding: 10px 20px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-info {
    padding: 10px 20px;
    background-color: #17a2b8;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-info:hover {
    background-color: #138496;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-warning {
    padding: 10px 20px;
    background-color: #ffc107;
    color: #333;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-warning:hover {
    background-color: #e0a800;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* ===== 토글 스위치 ===== */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
}

input:checked + .slider {
    background-color: #667eea;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

/* ===== 로딩 오버레이 ===== */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== 테이블 스타일 (Trade/Status용) ===== */
.styled-table {
    width: 100%;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.styled-table thead tr {
    background: #667eea;
    color: white;
    text-align: left;
    font-weight: 600;
}

.styled-table th,
.styled-table td {
    padding: 15px;
}

.styled-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
}

.styled-table tbody tr:last-child {
    border-bottom: none;
}

.styled-table tbody tr:hover {
    background-color: #f8f9fa;
}

.styled-table input {
    width: 100%;
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95rem;
}

.styled-table input:focus {
    outline: none;
    border-color: #667eea;
}

.styled-table input:read-only {
    background-color: #f5f5f5;
}

/* ===== 반응형 디자인 ===== */
@media (max-width: 768px) {
    .page-header {
        padding: 12px 14px;
    }

    .page-title h1 {
        font-size: 1rem;
    }

    .menu-grid {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .schedule-field-group {
        grid-template-columns: 1fr;
    }

    .bot-field-group {
        grid-template-columns: 1fr;
    }

    .status-grid {
        grid-template-columns: 1fr;
    }

    .telegram-button-group {
        grid-template-columns: 1fr;
    }

    .radio-options {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .page-header {
        padding: 8px 10px;
    }

    .page-title h1 {
        font-size: 0.95rem;
    }

    .section-title {
        font-size: 1rem;
    }

    .schedule-card,
    .bot-card,
    .status-card,
    .telegram-card,
    .info-card {
        padding: 15px;
    }
}
