* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 100vh;
}

/* TOP NAV */
.top-nav {
    width: 100%;
    height: 64px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 0 20px;
    gap: 8px;
}

.top-nav-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.top-nav-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.academy-logo {
    position: absolute;
    right: 20px;
    height: 40px;
    max-height: 20px;
    object-fit: contain;
}

/* NAV BAR - main.css와 동일한 스타일 */
.nav {
    width: 240px;
    background: #fff;
    border-right: 1px solid #eee;
    height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
    transition: width 0.3s, left 0.3s;
    position: fixed;
    left: 0;
    top: 64px;
    z-index: 100;
}

.nav.collapsed {
    width: 72px;
}

.nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.icon-logo {
    width: 30px;
    height: 30px;
}

.logo-text {
    font-weight: bold;
    font-size: 16px;
    white-space: nowrap;
}

.nav.collapsed .logo-text {
    display: none;
}

.nav-toggle {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

.nav.collapsed .nav-toggle {
    display: none;
}

.menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.menu li {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    gap: 12px;
    cursor: pointer;
    color: #444;
    transition: background 0.2s;
}

.menu li:hover {
    background: #f5f5f5;
}

.menu li.active {
    background: #007aff;
    color: white;
}

.menu li img {
    width: 24px;
    height: 24px;
}

.menu li i {
    width: 24px;
    font-size: 18px;
    text-align: center;
}

.menu li span {
    font-size: 14px;
    white-space: nowrap;
}

.nav.collapsed .menu li span {
    display: none;
}

.nav.collapsed .menu li {
    padding: 14px 24px;
    justify-content: center;
}

/* 메인 컨테이너 */
.container {
    flex: 1;
    margin-left: 240px;
    margin-top: 64px;
    padding: 30px;
    transition: margin-left 0.3s;
    max-width: 100%;
    width: 100%;
}

body.nav-collapsed .container {
    margin-left: 72px;
}

/* 콘텐츠 래퍼 */
.content-wrapper {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* 콘텐츠 헤더 */
.content-header {
    margin-bottom: 30px;
}

.content-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 20px;
}

/* 탭 메뉴 */
.tabs {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 10px;
}

.tab-button {
    padding: 8px 16px;
    background: none;
    border: none;
    color: #6e6e73;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.tab-button:hover {
    background: #f5f5f7;
    color: #1d1d1f;
}

.tab-button.active {
    background: #4aa3f0;
    color: #fff;
}

/* 카드 그리드 */
.cards-container {
    margin-top: 30px;
}

/* 회사별 섹션 */
.company-section {
    margin-bottom: 40px;
}

.company-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e5e5;
}

.company-title {
    font-size: 24px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.company-title i {
    color: #007aff;
    font-size: 20px;
}

.book-count {
    background: #f5f5f7;
    color: #6e6e73;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
}

.company-books {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.individual-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

/* 책 카드 */
.book-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid #e5e5e5;
    position: relative;
    display: flex;
    flex-direction: column;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-color: #4aa3f0;
}

/* 카드 배지 */
.card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    display: flex;
    gap: 5px;
}

.card-badge span {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-itq {
    background: #007aff;
    color: #fff;
}

.badge-diat {
    background: #5856d6;
    color: #fff;
}

.badge-cos {
    background: #ff9500;
    color: #fff;
}

.badge-etc {
    background: #8e8e93;
    color: #fff;
}

.badge-program {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
}

.badge-coming-soon {
    background: #ff3b30;
    color: #fff;
    font-weight: 700;
    animation: pulse 2s ease-in-out infinite;
}

.badge-new {
    background: #34c759;
    color: #fff;
    font-weight: 700;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* 카드 이미지 */
.card-image {
    width: 100%;
    height: 280px;
    background: #f5f5f7;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: #fff;
    padding: 10px;
}

.placeholder-image {
    color: #c7c7cc;
    font-size: 60px;
}

/* 카드 콘텐츠 */
.card-content {
    padding: 15px;
    flex: 1;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-publisher {
    font-size: 12px;
    color: #007aff;
    margin-bottom: 4px;
}

.card-meta {
    font-size: 12px;
    color: #8e8e93;
}

/* 카드 푸터 */
.card-footer {
    padding: 15px;
    border-top: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.update-date {
    font-size: 11px;
    color: #8e8e93;
    display: flex;
    align-items: center;
    gap: 5px;
}

.start-btn {
    background: #4aa3f0;
    border: 1px solid #4aa3f0;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    justify-content: center;
}

.start-btn:hover {
    background: #fff;
    border: 1px solid #4aa3f0;
    color: #4aa3f0;
}

/* 빈 상태 */
.no-books {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #8e8e93;
}

.no-books i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #c7c7cc;
}

.no-books p {
    font-size: 16px;
}

/* 반응형 디자인 */
@media (min-width: 1920px) {
    .company-books,
    .individual-cards {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (min-width: 1440px) and (max-width: 1919px) {
    .company-books,
    .individual-cards {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 1439px) and (min-width: 1025px) {
    .company-books,
    .individual-cards {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 1024px) {
    .company-books,
    .individual-cards {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .nav {
        left: -240px;
    }

    .nav.mobile-open {
        left: 0;
    }

    .container {
        margin-left: 0;
        padding: 20px;
    }

    body.nav-collapsed .container {
        margin-left: 0;
    }

    .company-books,
    .individual-cards {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .card-image {
        height: 250px;
    }

    .tabs {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 10px;
    }

    .tab-button {
        flex-shrink: 0;
    }

    .top-nav {
        padding: 0 15px;
    }

    .top-nav-title {
        font-size: 16px;
    }

    .academy-logo {
        display: none;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    .content-wrapper {
        padding: 20px 15px;
    }

    .company-books,
    .individual-cards {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    .card-image {
        height: 200px;
    }

    .top-nav {
        padding: 0 10px;
    }

    .top-nav-title {
        font-size: 14px;
    }

    .top-nav-logo {
        width: 32px;
        height: 32px;
    }

    .academy-logo {
        display: none;
    }
}

