/**
 * Reading Tracker Frontend CSS
 * 첨부하신 디자인 파일 스타일 적용
 */

.rt-frontend-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 헤더 */
.rt-header {
    margin-bottom: 2rem;
}

.rt-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rt-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rt-logo {
    width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(135deg, #3b82f6 0%, #9333ea 100%);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.rt-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

/* 탭 */
.rt-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.rt-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.rt-tab:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.rt-tab.active {
    background: #030213;
    color: white;
    border-color: #030213;
}

.rt-tab svg,
.rt-tab i {
    width: 1rem;
    height: 1rem;
}

.rt-tab-count {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* 검색 바 */
.rt-search-bar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
    .rt-search-bar {
        flex-direction: row;
    }
}

.rt-search-input-wrapper {
    flex: 1;
    position: relative;
}

.rt-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: #9ca3af;
}

.rt-search-input {
    width: 100%;
    padding: 0.625rem 0.75rem 0.625rem 2.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background: #f3f3f5;
    transition: all 0.2s;
}

.rt-search-input:focus {
    outline: none;
    border-color: #030213;
    background: white;
}

.rt-filter-controls {
    display: flex;
    gap: 0.5rem;
}

.rt-category-select {
    padding: 0.625rem 2rem 0.625rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background: #f3f3f5;
    cursor: pointer;
}

.rt-reset-button {
    padding: 0.625rem 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.rt-reset-button:hover {
    background: #f9fafb;
}

/* 통계 뷰 */
.rt-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.rt-stat-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
}

.rt-stat-icon {
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, #3b82f6 0%, #9333ea 100%);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.rt-stat-content {
    flex: 1;
}

.rt-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.rt-stat-label {
    font-size: 0.875rem;
    color: #6b7280;
}

/* 차트 */
.rt-chart-container {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.rt-chart-container h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #111827;
}

.rt-category-chart {
    min-height: 300px;
}

/* 책 그리드 */
.rt-books-container {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
}

.rt-books-grid {
    padding: 1.5rem;
}

.rt-books-grid table {
    width: 100%;
    border-collapse: collapse;
}

.rt-books-grid thead {
    background: #f9fafb;
}

.rt-books-grid th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

.rt-books-grid td {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.rt-books-grid tr:last-child td {
    border-bottom: none;
}

.rt-book-cover {
    width: 2.5rem;
    height: 3.5rem;
    object-fit: cover;
    border-radius: 0.25rem;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.rt-book-title {
    font-weight: 600;
    color: #111827;
}

.rt-book-author {
    color: #6b7280;
    font-size: 0.875rem;
}

.rt-badge {
    display: inline-flex;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.rt-badge-reading {
    background: #dbeafe;
    color: #1e40af;
}

.rt-badge-completed {
    background: #d1fae5;
    color: #065f46;
}

.rt-badge-wishlist {
    background: #f3f4f6;
    color: #374151;
}

.rt-badge-category {
    background: white;
    border: 1px solid #e5e7eb;
    color: #374151;
}

.rt-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #fbbf24;
}

/* 로딩 */
.rt-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    color: #6b7280;
}

.rt-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.rt-empty-state {
    text-align: center;
    padding: 4rem 1rem;
}

.rt-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.rt-empty-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.rt-empty-text {
    color: #6b7280;
}

/* 반응형 */
@media (max-width: 768px) {
    .rt-title {
        font-size: 1.5rem;
    }
    
    .rt-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .rt-books-grid {
        overflow-x: auto;
    }
    
    .rt-books-grid table {
        min-width: 600px;
    }
}
