:root {
    --bg-dark: #0a0e17;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-hover-bg: rgba(255, 255, 255, 0.06);
    --card-hover-border: rgba(255, 255, 255, 0.2);
    
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-teal: #14b8a6;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Noto Sans KR', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Background Animated Gradient Orbs */
.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, #0c1222 0%, #050811 100%);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: float 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: rgba(59, 130, 246, 0.2);
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: rgba(139, 92, 246, 0.15);
    bottom: -50px;
    right: -100px;
    animation-delay: -5s;
}

.orb-3 {
    width: 600px;
    height: 600px;
    background: rgba(20, 184, 166, 0.1);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, 30px) scale(1.05); }
    100% { transform: translate(-30px, 50px) scale(0.95); }
}

/* Main Container */
.portal-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 6rem 2rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.portal-header {
    text-align: center;
    margin-bottom: 5rem;
    animation: fadeDown 1s ease-out forwards;
}

.logo-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(59,130,246,0.2) 0%, rgba(139,92,246,0.2) 100%);
    color: var(--accent-blue);
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(255,255,255,0.1);
}

.portal-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.portal-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    font-weight: 300;
    letter-spacing: 0.05em;
}

/* Grid Layout */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

/* Glassmorphism Cards */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    box-shadow: 0 4px 24px -1px rgba(0, 0, 0, 0.2);
}

.service-card {
    text-decoration: none;
    color: inherit;
    position: relative;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform-style: preserve-3d;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s ease-out forwards;
}

/* Animation delays for sequential loading */
.service-card:nth-child(1) { animation-delay: 0.1s; }
.service-card:nth-child(2) { animation-delay: 0.2s; }
.service-card:nth-child(3) { animation-delay: 0.3s; }
.service-card:nth-child(4) { animation-delay: 0.4s; }
.service-card:nth-child(5) { animation-delay: 0.5s; }

.service-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(800px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255,255,255,0.06), transparent 40%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.service-card:hover {
    transform: translateY(-8px) scale(1.02);
    background: var(--card-hover-bg);
    border-color: var(--card-hover-border);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.3), 0 0 20px rgba(59, 130, 246, 0.1);
}

.service-card:hover::before {
    opacity: 1;
}

.card-inner {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.service-card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Specific Icon Colors */
.erp-icon { color: #f59e0b; background: rgba(245, 158, 11, 0.1); }
.chart-icon { color: #10b981; background: rgba(16, 185, 129, 0.1); }
.pacs-icon { color: #3b82f6; background: rgba(59, 130, 246, 0.1); }
.dicom-icon { color: #8b5cf6; background: rgba(139, 92, 246, 0.1); }
.main-icon { color: #ec4899; background: rgba(236, 72, 153, 0.1); }

.card-content {
    display: flex;
    flex-direction: column;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Featured Badge */
.featured {
    grid-column: span 2;
    background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, rgba(59, 130, 246, 0.08) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.featured:hover {
    border-color: rgba(59, 130, 246, 0.4);
}

.featured-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Footer */
.portal-footer {
    margin-top: auto;
    padding-top: 5rem;
    color: rgba(255,255,255,0.3);
    font-size: 0.85rem;
    font-family: var(--font-heading);
}

/* Responsive */
@media (max-width: 768px) {
    .portal-title { font-size: 2.5rem; }
    .featured { grid-column: span 1; }
    .cards-grid { grid-template-columns: 1fr; }
    .portal-container { padding-top: 3rem; }
}

/* Animations */
@keyframes fadeUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeDown {
    0% { opacity: 0; transform: translateY(-30px); }
    100% { opacity: 1; transform: translateY(0); }
}
