/* EPICS Portal - Complete CSS */

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #ffffff !important;
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
    line-height: 1.6;
    margin-top: 0 !important;
    padding-top: 220px !important;
}

/* ===== GLASS MORPHISM CONTAINER ===== */
.glass-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
}

/* ===== COMBINED HEADER ===== */
.combined-header {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    position: relative;
    overflow: hidden;
    height: 60px;
}

.combined-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><linearGradient id="grad" x1="0%" y1="0%" x2="100%" y2="0%"><stop offset="0%" style="stop-color:rgba(255,255,255,0.1);stop-opacity:1" /><stop offset="100%" style="stop-color:rgba(255,255,255,0.05);stop-opacity:1" /></linearGradient></defs><rect width="100" height="20" fill="url(%23grad)"/></svg>') repeat-x;
    opacity: 0.3;
}

/* Logo Section - Left */
.logo-section {
    position: relative;
    z-index: 1;
}

.logo {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(45deg, #fff, #f0f8ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    line-height: 1;
}

.subtitle {
    font-size: 0.9rem;
    opacity: 1;
    font-weight: 300;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    margin-top: 0.2rem;
}

/* Navigation Links - Fixed Top Right */
.nav-links {
    display: flex;
    gap: 0;
    position: absolute;
    top: 0.2rem;
    right: 2rem;
    z-index: 10;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.2rem 0.4rem;
    transition: all 0.3s ease;
    background: transparent;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.nav-link i {
    width: 14px;
    text-align: center;
    font-size: 0.9em;
}

.nav-link:last-child {
    border-right: none;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
}

/* ===== SUB MENU WITH DROPDOWN ===== */
.sub-menu {
    background: #d9531e;
    padding: 0.5rem 2rem 0rem 2rem;
    border-bottom: 1px solid #b8441a;
    position: relative;
    z-index: 100;
}

.sub-menu-tabs {
    display: flex;
    gap: 0;
}

/* Sub Menu 드롭다운 구조 */
.sub-tab-dropdown {
    position: relative;
    display: inline-block;
}

.sub-tab {
    background: transparent;
    color: white;
    border: none;
    padding: 0.2rem 1rem;
    cursor: pointer;
    border-right: 1px solid #4788c7;
    font-size: 0.85rem;
    font-family: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.sub-tab:last-child {
    border-right: none;
}

.sub-tab:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
}

.sub-tab.active {
    background: #fff !important;
    color: #d9531e !important;
    font-weight: 600;
}

/* 드롭다운 아이콘 */
.dropdown-icon {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.sub-tab-dropdown:hover .dropdown-icon {
    transform: rotate(180deg);
}

/* 드롭다운 콘텐츠 */
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 0.5rem 0;
    margin-top: 0;
    backdrop-filter: blur(20px);
    opacity: 0;
    transform: none;
    transition: all 0.3s ease;
}

/* 드롭다운 표시 */
.sub-tab-dropdown:hover .dropdown-content {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* 드롭다운 메뉴 아이템 */
.dropdown-content a {
    color: #333;
    padding: 0.75rem 1rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background: linear-gradient(45deg, #4facfe, #00f2fe);
    color: white;
    transform: translateX(5px);
}

.dropdown-content a i {
    width: 16px;
    text-align: center;
    opacity: 0.7;
}

.dropdown-content a:hover i {
    opacity: 1;
}

/* 드롭다운 화살표 표시 */
.dropdown-content::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #ffffff;
    filter: drop-shadow(0 -2px 4px rgba(0, 0, 0, 0.1));
}

/* 드롭다운 호버 영역 확장 */
.sub-tab-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 0.5rem;
    background: transparent;
}

/* 드롭다운 메뉴가 활성화된 상태에서 부모 스타일 유지 */
.sub-tab-dropdown:hover .sub-tab {
    background: rgba(255, 255, 255, 0.25);
}

.sub-tab-dropdown:hover .sub-tab.active {
    background: #fff !important;
    color: #d9531e !important;
}

/* ===== TOP과 BODY 사이 간격 ===== */
.top-body-spacer {
    height: 2rem;
    background: transparent;
}

/* ===== MAIN CONTAINER ===== */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding-bottom: 2rem;
}

/* ===== MAIN LAYOUT ===== */
.main-layout {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 2rem;
    min-height: calc(100vh - 200px);
}

.sidebar {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(25px);
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.sidebar-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sidebar-title {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.sidebar-title i {
    font-size: 0.8rem;
    opacity: 0.8;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

/* 메뉴 아이템 개선 */
.menu-item {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    position: relative;
}

.menu-item span {
    flex: 1;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(5px);
}

.menu-item i:first-child {
    width: 16px;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.8;
}

.menu-item:hover i:first-child {
    opacity: 1;
}

/* 메뉴 배지 */
.menu-badge {
    background: rgba(79, 172, 254, 0.8);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: auto;
}

.menu-badge.completed {
    background: rgba(76, 175, 80, 0.8);
}

.menu-badge.notification {
    background: rgba(244, 67, 54, 0.8);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(244, 67, 54, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0);
    }
}

/* 외부 링크 표시 */
.menu-external {
    font-size: 0.7rem;
    opacity: 0.6;
    margin-left: auto;
}

.menu-item.external:hover .menu-external {
    opacity: 1;
}

/* 시간 표시 */
.menu-time {
    font-size: 0.7rem;
    opacity: 0.6;
    margin-left: auto;
}

.menu-item.activity:hover .menu-time {
    opacity: 0.8;
}

/* 시스템 상태 그리드 */
.status-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-indicator.online {
    background: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
}

.status-indicator.warning {
    background: #FF9800;
    box-shadow: 0 0 0 2px rgba(255, 152, 0, 0.3);
}

.status-indicator.offline {
    background: #f44336;
    box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.3);
}

/* 토글 스위치 */
.toggle-switch {
    position: relative;
    margin-left: auto;
}

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

.toggle-switch label {
    display: block;
    width: 40px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.toggle-switch label::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
}

.toggle-switch input:checked + label {
    background: rgba(79, 172, 254, 0.8);
}

.toggle-switch input:checked + label::after {
    transform: translateX(20px);
}

/* ===== BODY SECTION ===== */
#body-section {
    flex: 1;
    min-width: 0;
}

.main-content {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    min-height: calc(100vh - 240px);
    margin-top: 50px !important;
}

/* Service Tabs - Body 내부 */
.main-content .service-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem 0;
    border-bottom: 2px solid #f0f0f0;
}

/* Tab 버튼 스타일 */
.main-content .tab-btn {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border: 2px solid #e0e0e0;
    color: #333;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.main-content .tab-btn:hover {
    background: linear-gradient(145deg, #f8f9fa, #ffffff);
    border-color: #4facfe;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.main-content .tab-btn.active {
    background: linear-gradient(45deg, #4facfe, #00f2fe);
    border-color: transparent;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
}

/* Content transition */
.tab-content {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    display: none;
}

.tab-content.active {
    opacity: 1;
    transform: translateY(0);
    display: block;
}

/* Content Header */
.content-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #eee;
}

.content-title {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
}

.content-subtitle {
    color: #666;
    font-size: 1.1rem;
}

/* ===== DASHBOARD GRID ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* ===== SERVICE CARDS ===== */
.service-card {
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-online {
    background: linear-gradient(45deg, #4CAF50, #8BC34A);
    color: white;
}

.status-offline {
    background: linear-gradient(45deg, #f44336, #ff5722);
    color: white;
}

.card-description {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.card-stats {
    margin-bottom: 1.5rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.stat-label {
    color: #666;
}

.stat-value {
    font-weight: 600;
    color: #333;
}

/* Action Buttons */
.card-actions {
    display: flex;
    gap: 1rem;
}

.btn {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 15px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    color: white;
}

.btn-plane {
    background: linear-gradient(45deg, #9c27b0, #e91e63);
}

.btn-redmine {
    background: linear-gradient(45deg, #f44336, #ff5722);
}

.btn-distribution {
    background: linear-gradient(45deg, #4caf50, #8bc34a);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* ===== IFRAME STYLES ===== */
.iframe-container {
    width: 100%;
    height: 700px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ===== SCROLLBAR STYLES ===== */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===== LOADING ANIMATION ===== */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 400px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .main-layout {
        flex-direction: column;
        padding: 0 1rem 2rem;
    }
    
    #left-section {
        width: 100%;
        position: static;
        max-height: none;
        order: -1;
    }
    
    .nav-links {
        flex-wrap: wrap;
        position: relative;
        top: auto;
        right: auto;
    }

.combined-header {
    background: linear-gradient(135deg, #1976D2 0%, #42A5F5 100%);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    position: relative;
    overflow: hidden;
    height: 60px;
}
    
    .sidebar {
        max-height: none;
        overflow: visible;
    }
    
    .status-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .dropdown-content {
        min-width: 200px;
        left: -50px;
    }
    
    .dropdown-content::before {
        left: 70px;
    }
}

@media (max-width: 768px) {
    .logo {
        font-size: 1.8rem;
    }
    
    .combined-header {
        padding: 1rem;
    }
    
    .main-layout {
        gap: 1rem;
    }
    
    .main-content {
        padding: 1.5rem;
    }
    
    .main-content .service-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 1rem;
    }
    
    .main-content .tab-btn {
        flex-shrink: 0;
        min-width: 80px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .nav-links {
        position: relative;
        top: auto;
        right: auto;
    }
    
    .sidebar-section {
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }
    
    .menu-item {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .status-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.3rem;
    }
    
    .status-item {
        padding: 0.4rem;
        font-size: 0.75rem;
    }
    
    .sub-tab {
        padding: 0.3rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .dropdown-content a {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* ===== FOOTER STYLES ===== */
/* Footer styles are now controlled via title.json settings */
/* Default fallback styles only - can be overridden by inline styles */
footer {
    color: white;
}

footer a {
    color: inherit;
    text-decoration: none;
}

footer a:hover {
    opacity: 0.8;
}

/* ===== MARGIN/PADDING/BORDER RESET ===== */
html, body, #app, #wrap, main {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    box-shadow: none !important;
}
