/* ========================================
   HISTORY PAGE STYLES
   ======================================== */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Hero Section */
.history-hero {
    position: relative;
    min-height: 40vh;
    background-image: url('../../images/aptech_history.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 140px 30px 40px 30px;
    overflow: hidden;
    margin-top: 0;
}

.history-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.history-hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.history-hero-content h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 48px;
    font-weight: 800;
    margin: 0 0 25px 0;
    letter-spacing: 1px;
    line-height: 1.1;
    color: white;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease 0.3s forwards;
}

.history-hero-content p {
    font-family: 'Pretendard', sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.6;
    margin: 0;
    color: white;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s ease 0.6s forwards;
    word-break: keep-all;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sub Navigation */
.sub-navigation {
    background: white;
    width: 100%;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 100;
}

.sub-nav-container {
    display: flex;
    border-bottom: 2px solid #f1f3f4;
    position: relative;
    max-width: 800px;
    width: 100%;
    margin: 0 20px;
}

.sub-nav-item {
    flex: 1;
    padding: 20px 15px;
    text-decoration: none;
    color: #2d3436;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    background: white;
    position: relative;
    white-space: nowrap;
    font-family: 'Pretendard', sans-serif;
}

.sub-nav-item:not(:first-child) {
    border-left: 1px solid #f1f3f4;
}

.sub-nav-item:hover {
    color: #6c757d;
    border-bottom-color: #f58f27;
}

.sub-nav-item.active {
    color: #6c757d;
    font-weight: 600;
    border-bottom-color: #f58f27;
}

/* Main Content Section */
.history-content {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 80px 0;
    position: relative;
}

.history-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

/* Header */
.history-header {
    text-align: center;
    margin-bottom: 80px;
}

.history-label {
    color: #f58f27;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 2px;
    margin-bottom: 20px;
    text-transform: uppercase;
    font-family: 'Inter', sans-serif;
}

.history-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 48px;
    font-weight: 700;
    color: #2d3436;
    margin: 0 0 10px 0;
    line-height: 1.2;
}

.history-subtitle {
    font-size: 16px;
    color: #6c757d;
    line-height: 1.7;
    max-width: 600px;
    margin: 0 auto;
    word-break: keep-all;
    font-family: 'Pretendard', sans-serif;
}

/* Timeline */
.timeline-wrapper {
    max-width: 1400px;
    margin: 0 auto;
}

.timeline-item {
    display: flex;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(108, 117, 125, 0.2);
    align-items: flex-start;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-year {
    font-family: 'Montserrat', sans-serif;
    font-size: 21px;
    font-weight: 700;
    color: #6c757d;
    min-width: 80px;
    margin-right: 40px;
    line-height: 1;
    margin-top: 3px;
    flex-shrink: 0;
}

.timeline-year.highlight {
    color: #f58f27;
}

.timeline-content {
    flex: 1;
    line-height: 1.6;
}

.timeline-entry {
    display: block;
    margin-bottom: 8px;
}

.timeline-entry:last-child {
    margin-bottom: 0;
}

.entry-title {
    font-size: 15px;
    font-weight: 600;
    color: #2d3436;
    margin-right: 15px;
    word-break: keep-all;
    font-family: 'Pretendard', sans-serif;
}

.entry-detail {
    font-size: 11px;
    color: #6c757d;
    font-family: 'Pretendard', sans-serif;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .history-hero {
        min-height: 35vh;
        padding: 100px 20px 30px 20px;
    }
    
    .history-hero-content h1 {
        font-size: 28px;
        margin-bottom: 15px;
    }
    
    .history-hero-content p {
        font-size: 14px;
        line-height: 1.5;
    }
    
    /* Sub Navigation Mobile */
    .sub-nav-container {
        overflow: visible;
        overflow-y: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
        scroll-behavior: smooth;
        scroll-snap-type: none;
        justify-content: center;
        margin: 0 auto;
        max-width: 520px;
    }
    
    .sub-nav-container::-webkit-scrollbar {
        display: none;
    }
    
    .sub-nav-item {
        font-size: 14px;
        padding: 16px 8px;
        flex: 1;
        min-width: 0;
        flex-shrink: 1;
    }
    
    /* Content Mobile */
    .history-content {
        padding: 60px 0;
    }
    
    .history-container {
        padding: 0 20px;
    }
    
    .history-header {
        margin-bottom: 60px;
        text-align: center;
    }
    
    .history-label {
        font-size: 12px;
        margin-bottom: 15px;
    }
    
    .history-title {
        font-size: 42px;
        margin-bottom: 15px;
    }
    
    .history-subtitle {
        font-size: 15px;
        max-width: 280px;
        margin: 0 auto;
        word-break: keep-all;
        line-height: 1.6;
    }
    
    /* Timeline Mobile */
    .timeline-item {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 25px;
        padding-bottom: 20px;
    }
    
    .timeline-year {
        min-width: auto;
        margin-right: 0;
        margin-bottom: 10px;
        font-size: 18px;
        margin-top: 0;
    }
    
    .entry-title {
        font-size: 13px;
        display: block;
        margin-bottom: 4px;
        margin-right: 0;
    }
    
    .entry-detail {
        font-size: 11px;
        display: block;
        margin-bottom: 8px;
        margin-left: 0;
    }
    
    .timeline-content {
        line-height: 1.6;
    }
    
    .timeline-entry {
        margin-bottom: 12px;
    }
    
    .timeline-entry:last-child {
        margin-bottom: 0;
    }
}

@media (max-width: 480px) {
    .sub-nav-item {
        font-size: 13px;
        padding: 14px 6px;
    }
}

@media (max-width: 360px) {
    .sub-nav-container {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        justify-content: flex-start;
    }
    
    .sub-nav-item {
        font-size: 12px;
        padding: 12px 4px;
        flex: none;
        min-width: 80px;
        flex-shrink: 0;
    }
}

/* Animation Performance Optimization */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
