/* ================================
   기본 스타일
   ================================ */
:root {
    --primary-color: #05214d;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    
    --font-family-sans-serif: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --transition-speed: 0.3s;
}

body {
    font-family: var(--font-family-sans-serif);
    line-height: 1.6;
    color: var(--dark-color);
}

html {
    scroll-behavior: smooth;
}

/* ================================
   레이아웃
   ================================ */
.main-content {
    padding-top: 65px; /* 네비게이션 높이 */
    min-height: calc(100vh - 76px);
}

/* ================================
   네비게이션
   ================================ */
.navbar {
    background-color: #05214d !important; /* 진한 네이비 색상으로 변경 */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

/* CTA 섹션 (문의하기 버튼 구역) */
.bg-primary {
    background-color: #05214d !important; /* 네비게이션과 동일한 색상 */
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.75rem 1rem;
    transition: color var(--transition-speed) ease;
}

.navbar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 0.8) !important;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
}

/* ================================
   히어로 섹션
   ================================ */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
}

/* 배경 이미지가 있는 히어로 섹션 */
#hero-with-bg {
    /* 기본 배경 (관리자에서 설정하지 않은 경우) */
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.651) 0%, rgba(118, 75, 162, 0.082) 100%), 
                   url('../images/ncp-bg.jpg') center/cover no-repeat;
    background-attachment: fixed;
    position: relative;
    overflow: hidden;
}

/* 동영상 배경 스타일 */
.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -1;
    transform: translateX(-50%) translateY(-50%);
    object-fit: cover;
}

/* 히어로 오버레이가 동영상 위에 표시되도록 */
.hero-overlay {
    position: relative;
    z-index: 1;
}

.hero-overlay {
    background: rgba(0, 0, 0, 0.3);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-content {
    backdrop-filter: blur(2px);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.text-white-75 {
    color: rgba(255, 255, 255, 0.75) !important;
}

/* ================================
   페이지 헤더
   ================================ */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #495057 100%);
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><defs><radialGradient id="a" cx="50%" cy="0%" r="100%"><stop offset="0%" stop-color="white" stop-opacity="0.1"/><stop offset="100%" stop-color="white" stop-opacity="0"/></radialGradient></defs><rect width="100" height="20" fill="url(%23a)"/></svg>');
    opacity: 0.1;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.5);
}

/* ================================
   카드
   ================================ */
.card {
    border: none;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all var(--transition-speed) ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

.card-img-top {
    transition: transform var(--transition-speed) ease;
}

.card:hover .card-img-top {
    transform: scale(1.05);
}

/* ================================
   특허 및 인증서 이미지
   ================================ */
.patent-image-container,
.cert-image-container {
    position: relative;
    border-radius: 0.375rem 0.375rem 0 0;
    overflow: hidden;
    background: linear-gradient(45deg, #f8f9fa 25%, transparent 25%), 
                linear-gradient(-45deg, #f8f9fa 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #f8f9fa 75%), 
                linear-gradient(-45deg, transparent 75%, #f8f9fa 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.patent-image-container::after,
.cert-image-container::after {
    content: '🔍 클릭하여 확대';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.875rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.patent-image-container:hover::after,
.cert-image-container:hover::after {
    opacity: 1;
}

.patent-image-container img,
.cert-image-container img {
    border-radius: 0;
}

/* 인증서 이미지 슬라이더 */
.cert-image-carousel {
    border-radius: 0.375rem 0.375rem 0 0;
    overflow: hidden;
}

.cert-image-carousel .carousel-control-prev,
.cert-image-carousel .carousel-control-next {
    width: 8%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cert-image-carousel:hover .carousel-control-prev,
.cert-image-carousel:hover .carousel-control-next {
    opacity: 0.8;
}

.cert-image-carousel .carousel-control-prev-icon,
.cert-image-carousel .carousel-control-next-icon {
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    padding: 10px;
    width: 40px;
    height: 40px;
}

.cert-image-carousel .carousel-indicators {
    margin-bottom: 0.5rem;
}

.cert-image-carousel .carousel-indicators [data-bs-target] {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin: 0 3px;
    background-color: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(0, 0, 0, 0.3);
}

.cert-image-carousel .carousel-indicators [data-bs-target].active {
    background-color: white;
    border-color: var(--primary-color);
}

.image-counter {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 600;
    z-index: 10;
}

/* 모달 이미지 슬라이더 */
#modalCarousel {
    background: #000;
}

#modalCarousel .carousel-control-prev,
#modalCarousel .carousel-control-next {
    width: 10%;
    opacity: 0.8;
}

#modalCarousel .carousel-control-prev-icon,
#modalCarousel .carousel-control-next-icon {
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    padding: 15px;
    width: 50px;
    height: 50px;
}

#modalCarousel .carousel-control-prev:hover .carousel-control-prev-icon,
#modalCarousel .carousel-control-next:hover .carousel-control-next-icon {
    background-color: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

#modalCarousel .carousel-indicators {
    margin-bottom: 1rem;
}

#modalCarousel .carousel-indicators [data-bs-target] {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 4px;
    background-color: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.8);
}

#modalCarousel .carousel-indicators [data-bs-target].active {
    background-color: #fff;
    border-color: var(--primary-color);
}

/* 모달 크기 조정 */
.modal-xl {
    max-width: 90vw;
}

@media (max-width: 768px) {
    .modal-xl {
        max-width: 95vw;
        margin: 1rem;
    }
    
    #modalCarousel .carousel-control-prev,
    #modalCarousel .carousel-control-next {
        width: 15%;
    }
    
    #modalCarousel .carousel-control-prev-icon,
    #modalCarousel .carousel-control-next-icon {
        width: 40px;
        height: 40px;
        padding: 12px;
    }
}

/* ================================
   제품 카드
   ================================ */
.product-card {
    border: 2px solid transparent;
    transition: all var(--transition-speed) ease;
}

.product-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.product-card .badge {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
}

/* ================================
   사례 카드
   ================================ */
.case-card {
    transition: all var(--transition-speed) ease;
}

.case-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15) !important;
}

/* ================================
   문의 카드
   ================================ */
.inquiry-card {
    transition: all var(--transition-speed) ease;
    cursor: pointer;
}

.inquiry-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    border-color: var(--primary-color);
}

.inquiry-card .card-body:hover h6 a {
    color: var(--primary-color) !important;
}

/* ================================
   버튼
   ================================ */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    transition: all var(--transition-speed) ease;
    border-width: 2px;
}

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1.125rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    border-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

/* ================================
   폼
   ================================ */
.form-control {
    border-radius: 0.5rem;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    transition: all var(--transition-speed) ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* ================================
   페이지네이션
   ================================ */
.pagination .page-link {
    border-radius: 0.5rem;
    margin: 0 0.125rem;
    border: 2px solid transparent;
    color: var(--primary-color);
    font-weight: 500;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    border-color: var(--primary-color);
}

.pagination .page-link:hover {
    border-color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.1);
}

/* ================================
   아코디언
   ================================ */
.accordion-button {
    font-weight: 600;
    border-radius: 0.5rem !important;
}

.accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    color: white;
}

.accordion-item {
    border: none;
    margin-bottom: 1rem;
    border-radius: 0.5rem !important;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ================================
   섬네일 이미지
   ================================ */
.thumbnail-image {
    border: 3px solid transparent;
    transition: all var(--transition-speed) ease;
    cursor: pointer;
}

.thumbnail-image:hover,
.thumbnail-image.active {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

/* ================================
   로딩 애니메이션
   ================================ */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ================================
   유틸리티
   ================================ */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-hover {
    transition: box-shadow var(--transition-speed) ease;
}

.shadow-hover:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

/* ================================
   푸터
   ================================ */
footer {
    background: linear-gradient(135deg, #1a252f 0%, #2c3e50 100%);
    color: #ffffff !important;
}

/* 모든 제목 요소들 */
footer h1,
footer h2,
footer h3,
footer h4,
footer h5,
footer h6 {
    color: #ffffff !important;
    font-weight: 600;
}

/* 모든 텍스트 요소들 */
footer p,
footer li,
footer span,
footer small,
footer div,
footer .text-light,
footer .text-muted {
    color: #e9ecef !important;
}

/* 모든 링크 요소들 */
footer a,
footer a.text-muted,
footer a.text-light,
footer a.text-decoration-none {
    color: #e9ecef !important;
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

footer a:hover,
footer a.text-muted:hover,
footer a.text-light:hover {
    color: var(--primary-color) !important;
    text-decoration: none;
}

/* 아이콘 색상 */
footer i {
    color: #e9ecef !important;
}

/* 소셜 아이콘 */
footer .social-icons a {
    color: #e9ecef !important;
    font-size: 1.2rem;
    transition: all var(--transition-speed) ease;
}

footer .social-icons a:hover {
    color: var(--primary-color) !important;
    transform: translateY(-2px);
}

/* 구분선 */
footer hr,
footer .border-light {
    border-color: rgba(255, 255, 255, 0.3) !important;
}

/* ================================
   반응형 디자인
   ================================ */
@media (max-width: 768px) {
    .hero-section,
    #hero-with-bg {
        background-attachment: scroll;
    }
    
    .hero-content {
        padding: 2rem 1.5rem;
        margin: 1rem 0;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .display-5 {
        font-size: 1.75rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .card-img-top {
        height: 200px !important;
    }
    
    .main-product-image {
        max-height: 300px;
    }
}

@media (max-width: 576px) {
    .hero-section {
        min-height: 70vh;
    }
    
    .hero-overlay {
        min-height: 70vh;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .btn-group-vertical .btn {
        margin-bottom: 0.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .thumbnail-image {
        height: 60px !important;
    }
}

/* ================================
   인쇄 스타일
   ================================ */
@media print {
    .navbar,
    .btn,
    .pagination,
    footer {
        display: none !important;
    }
    
    .main-content {
        padding-top: 0;
    }
    
    .card {
        border: 1px solid #dee2e6 !important;
        box-shadow: none !important;
    }
}


/* ================================
   접근성
   ================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 키보드 네비게이션을 위한 포커스 스타일 */
.btn:focus,
.form-control:focus,
.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 고대비 모드 지원 */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid var(--dark-color);
    }
    
    .btn {
        border-width: 3px;
    }
}
