/* CSS Design System for Aura Workspace Portal */

:root {
    --bg-dark: #090a0f;
    --card-bg: rgba(20, 22, 33, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --primary-color: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.4);
    --accent-red: #ef4444;
    --font-outfit: 'Outfit', sans-serif;
    --font-inter: 'Inter', 'Noto Sans KR', sans-serif;
    --sidebar-width: 280px;
    
    --blue-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    --purple-gradient: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    
    --scroll-thumb: rgba(255, 255, 255, 0.12);
}

body.light-mode {
    --bg-dark: #f1f5f9; /* Soft Slate 100 */
    --card-bg: rgba(255, 255, 255, 0.75); /* Frosted white glass */
    --border-color: rgba(15, 23, 42, 0.08); /* Clean light borders */
    --text-primary: #0f172a; /* Slate 900 */
    --text-secondary: #475569; /* Slate 600 */
    --primary-color: #2563eb;
    --primary-glow: rgba(37, 99, 235, 0.2);
    
    --scroll-thumb: rgba(0, 0, 0, 0.15);
}

body.light-mode .background-glow {
    opacity: 0.04;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-inter);
    height: 100vh;
    overflow: hidden;
    position: relative;
    
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Background animated gradient blobs */
.background-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
    animation: float 25s infinite alternate;
}

.glow-1 {
    background: radial-gradient(circle, #3b82f6 0%, transparent 70%);
    top: -10%;
    left: -10%;
}

.glow-2 {
    background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
    bottom: -10%;
    right: -10%;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(80px, 50px) scale(1.1); }
    100% { transform: translate(-40px, -80px) scale(0.9); }
}

/* Glass card utility */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Portal Container */
.portal-container {
    display: flex;
    width: 100%;
    height: 100vh;
    padding: 24px;
    gap: 24px;
    z-index: 10;
    position: relative;
}

/* Sidebar Navigation */
.portal-sidebar {
    width: var(--sidebar-width);
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 28px 20px;
    flex-shrink: 0;
}

.sidebar-header {
    margin-bottom: 32px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: var(--accent-gradient);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    box-shadow: 0 0 15px var(--primary-glow);
}

.logo-icon i {
    width: 22px;
    height: 22px;
}

.logo-area h1 {
    font-family: var(--font-outfit);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.tagline {
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 600;
    margin-top: 2px;
}

/* Navigation items */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.nav-item {
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    width: 100%;
    color: var(--text-secondary);
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.25s ease;
    text-align: left;
    position: relative;
}

.nav-item i {
    width: 18px;
    height: 18px;
    transition: transform 0.25s ease;
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

body.light-mode .nav-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

.nav-item:hover i {
    transform: translateX(2px);
}

.nav-item.active {
    color: var(--primary-color);
    font-weight: 600;
    background: rgba(59, 130, 246, 0.1);
}

body.light-mode .nav-item.active {
    background: rgba(37, 99, 235, 0.08);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 4px;
    background: var(--primary-color);
    border-radius: 0 4px 4px 0;
}

/* Sidebar Footer buttons */
.sidebar-footer {
    display: flex;
    gap: 12px;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.footer-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    height: 44px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    text-decoration: none;
}

body.light-mode .footer-btn {
    background: rgba(0, 0, 0, 0.02);
}

.footer-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.08);
}

body.light-mode .footer-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.footer-btn i {
    width: 18px;
    height: 18px;
}

/* Viewport Area */
.portal-viewport {
    flex: 1;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevent flex overflow layout breaks */
}

/* Tab contents styling */
.tab-content {
    width: 100%;
    flex: 1;
    min-height: 0;
    opacity: 1;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
}

.tab-content.hide {
    display: none !important; /* Force hide regardless of flex overrides */
    opacity: 0;
}

/* Iframe view container */
.tool-iframe {
    flex: 1;
    width: 100%;
    min-height: 0;
    border: none;
    border-radius: 20px;
    display: block;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

/* Home Dashboard layout styling */
#tab-home {
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.welcome-section {
    margin-bottom: 8px;
}

.welcome-title {
    font-family: var(--font-outfit);
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

body.light-mode .welcome-title {
    background: linear-gradient(135deg, #0f172a 30%, #475569 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Dashboard Hub Tools Grid */
.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 24px;
}

.hub-card {
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.hub-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 20px;
    background: radial-gradient(circle at 100% 0%, rgba(255,255,255,0.03) 0%, transparent 60%);
    pointer-events: none;
}

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    margin-bottom: 8px;
}

.card-icon i {
    width: 26px;
    height: 26px;
}

.blue-gradient { background: var(--blue-gradient); }
.purple-gradient { background: var(--purple-gradient); }

.hub-card h3 {
    font-family: var(--font-outfit);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.hub-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    flex-grow: 1;
}

.hub-card .primary-btn {
    margin-top: 12px;
    align-self: flex-start;
}

.hover-glow:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08), 0 0 1px var(--primary-glow);
    border-color: rgba(59, 130, 246, 0.25);
    background: rgba(255, 255, 255, 0.03);
}

body.light-mode .hover-glow:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(37, 99, 235, 0.2);
}

/* Premium Buttons */
.primary-btn {
    background: var(--primary-color);
    border: none;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 12px 20px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.primary-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 18px var(--primary-glow);
    filter: brightness(1.1);
}

.primary-btn i {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.primary-btn:hover i {
    transform: translateX(4px);
}

/* Info Box */
.info-alert {
    display: flex;
    gap: 20px;
    padding: 24px;
    align-items: flex-start;
    margin-top: auto;
}

.info-icon {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
    flex-shrink: 0;
    margin-top: 2px;
}

.info-alert h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.info-alert p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.info-alert a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.info-alert a:hover {
    text-decoration: underline;
}

/* Webkit Scrollbar custom */
#tab-home::-webkit-scrollbar {
    width: 6px;
}

#tab-home::-webkit-scrollbar-track {
    background: transparent;
}

#tab-home::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb);
    border-radius: 3px;
}

#tab-home::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Responsive queries */
@media (max-width: 900px) {
    .portal-container {
        flex-direction: column;
        padding: 16px;
        gap: 16px;
    }
    
    .portal-sidebar {
        width: 100%;
        height: auto;
        padding: 18px;
    }
    
    .sidebar-header {
        margin-bottom: 16px;
    }
    
    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .nav-item {
        flex: 1;
        min-width: 120px;
        padding: 10px 14px;
        justify-content: center;
    }
    
    .nav-item.active::before {
        left: 20%;
        top: auto;
        bottom: 0;
        height: 3px;
        width: 60%;
        border-radius: 4px 4px 0 0;
    }
    
    .sidebar-footer {
        display: none; /* Hide footer buttons on mobile layout to save space */
    }
}

/* Real-time News Board styling for Portal */
.news-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 8px;
    width: 100%;
}

.news-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
}

.news-header h3 {
    font-family: var(--font-outfit);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.news-header h3 i {
    color: var(--primary-color);
    width: 20px;
    height: 20px;
}

/* Blinking Live Indicator */
.live-indicator {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    letter-spacing: 0.5px;
}

.live-dot {
    width: 6px;
    height: 6px;
    background-color: var(--accent-red);
    border-radius: 50%;
    display: inline-block;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.6; }
}

.news-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.news-feed-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 4px;
}

.news-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
    align-items: center;
}

body.light-mode .news-item {
    background: rgba(0, 0, 0, 0.01);
}

.news-item:hover {
    transform: translateY(-1px);
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.04);
}

body.light-mode .news-item:hover {
    background: rgba(37, 99, 235, 0.03);
}

.news-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.news-item-icon i {
    width: 16px;
    height: 16px;
}

.news-item-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.news-item-title {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.news-item:hover .news-item-title {
    color: var(--primary-color);
}

.news-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.news-item-source {
    font-weight: 700;
}

/* Spinner and loading states */
.news-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 10px;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.news-loading .spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: news-spin 1s linear infinite;
}

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

.news-feed-body::-webkit-scrollbar {
    width: 4px;
}

.news-feed-body::-webkit-scrollbar-track {
    background: transparent;
}

.news-feed-body::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb);
    border-radius: 2px;
}

/* Portal Social Login Button Hover Transitions */
.portal-social-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.portal-social-btn:hover {
    opacity: 0.9;
    transform: translateY(-1.5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hide {
    display: none !important;
}
