/* ========================================
   Public Employee Directory - Organizational Chart
   Modern, Clean & Responsive Design
   ======================================== */

/* Additional org-specific tokens */
:root {
    --org-primary-blue: #0047AB;
    --org-primary-pink: #E91E63;
    --org-light-pink: #FF80AB;
    --org-gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --org-gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --org-gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* ========================================
   LAYOUT
   ======================================== */

body {
    font-family: 'Phetsarath OT', 'Noto Sans Lao', sans-serif;
    background: linear-gradient(135deg, #FFF8F0 0%, #F5E6D3 50%, #f3f4f6 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* ========================================
   HEADER SECTION
   ======================================== */

.org-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem 1.5rem 0 0;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

.org-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.org-header::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

.org-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 4px 12px rgba(0, 0, 0, 0.2);
    line-height: 1.2;
    position: relative;
    z-index: 1;
    letter-spacing: -0.02em;
}

.org-subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    opacity: 0.95;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

/* ========================================
   NAVIGATION
   ======================================== */

.nav-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 2rem;
    background: linear-gradient(to bottom, #f9fafb, white);
    flex-wrap: wrap;
    gap: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.nav-btn {
    background: white;
    color: #6B3E26;
    padding: 0.75rem 1.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 44px;
    position: relative;
    overflow: hidden;
}

.nav-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #ECA869, #d86e3a);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 0;
}

.nav-btn:hover::before {
    opacity: 1;
}

.nav-btn:hover {
    border-color: #ECA869;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.nav-btn svg {
    width: 1.125rem;
    height: 1.125rem;
    position: relative;
    z-index: 1;
}

.nav-btn span {
    position: relative;
    z-index: 1;
}

/* ========================================
   CHART CONTENT
   ======================================== */

.chart-content {
    padding: 3rem 2rem;
    background: linear-gradient(to bottom, white, #f9fafb);
    border-radius: 0 0 1.5rem 1.5rem;
    min-height: 400px;
}

/* ========================================
   DEPARTMENT SECTION
   ======================================== */

.department-section {
    margin-bottom: 4rem;
    animation: fadeInUp 0.6s ease-out;
}

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

.department-header {
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(236, 168, 105, 0.05), rgba(245, 230, 211, 0.05));
    border-radius: 1.5rem;
    border: 1px solid rgba(107, 62, 38, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.department-header::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(to right, #ECA869, #E91E63);
    border-radius: 9999px;
    box-shadow: 0 2px 8px rgba(236, 168, 105, 0.4);
}

.department-icon {
    width: 4rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.department-icon svg {
    width: 2rem;
    height: 2rem;
    color: white;
    stroke-width: 2;
}

.department-header:hover .department-icon {
    transform: scale(1.1) rotate(6deg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.department-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: #6B3E26;
    margin: 0;
    background: linear-gradient(to right, #6B3E26, #ECA869);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.department-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.count-number {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(to right, #ECA869, #d86e3a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.count-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

/* ========================================
   EMPLOYEE GRID
   ======================================== */

.employee-level {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

/* ========================================
   EMPLOYEE CARDS
   ======================================== */

.employee-card {
    background: white;
    border-radius: 1.5rem;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid rgba(107, 62, 38, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.employee-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, #ECA869, #E91E63, #0047AB);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.employee-card:hover::before {
    transform: scaleX(1);
}

.employee-card:hover {
    transform: translateY(-0.75rem) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border-color: rgba(236, 168, 105, 0.3);
}

/* Photo Container */
.photo-container {
    position: relative;
    height: 8rem;
    background: linear-gradient(135deg, rgba(236, 168, 105, 0.1), #F5E6D3, rgba(216, 110, 58, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -1.5rem -1.5rem 1.25rem;
    overflow: hidden;
}

.photo-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(236, 168, 105, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.employee-card:hover .photo-container::after {
    opacity: 1;
}

.photo-wrapper {
    width: 6rem;
    height: 6rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #ECA869 0%, #E91E63 100%);
    padding: 3px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.employee-card:hover .photo-wrapper {
    transform: scale(1.1) rotate(6deg);
}

.photo-wrapper::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ECA869, #E91E63);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
    filter: blur(12px);
}

.employee-card:hover .photo-wrapper::after {
    opacity: 0.7;
}

.photo-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: #6B3E26;
    background: linear-gradient(135deg, #FFF8F0, #F5E6D3);
}

/* Employee Info */
.employee-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #6B3E26;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    letter-spacing: -0.01em;
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3rem;
}

.employee-card:hover .employee-name {
    background: linear-gradient(to right, #ECA869, #d86e3a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.employee-position {
    font-size: 0.875rem;
    color: white;
    font-weight: 600;
    margin-bottom: 1rem;
    padding: 0.375rem 1rem;
    background: linear-gradient(to right, #ECA869, #d86e3a);
    border-radius: 9999px;
    display: inline-block;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.employee-card:hover .employee-position {
    transform: scale(1.05);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.employee-details {
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.6;
    text-align: left;
    background: linear-gradient(to right, rgba(255, 248, 240, 0.5), rgba(245, 230, 211, 0.3));
    padding: 1rem;
    border-radius: 0.75rem;
    margin-top: auto;
    border-top: 1px solid rgba(107, 62, 38, 0.1);
}

.employee-details .detail-item {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(107, 62, 38, 0.05);
}

.employee-details .detail-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.detail-label {
    font-weight: 700;
    color: #6B3E26;
    flex-shrink: 0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.detail-value {
    color: #374151;
    font-weight: 500;
}

/* ========================================
   EMPTY STATE
   ======================================== */

.empty-state {
    text-align: center;
    padding: 5rem 1.5rem;
    color: #9ca3af;
    background: white;
    border-radius: 1.5rem;
    margin: 2rem;
    border: 1px solid rgba(107, 62, 38, 0.1);
}

.empty-state-icon-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.empty-state-blur {
    position: absolute;
    inset: 0;
    background: rgba(236, 168, 105, 0.2);
    border-radius: 9999px;
    filter: blur(2rem);
}

.empty-state svg {
    position: relative;
    width: 8rem;
    height: 8rem;
    margin: 0 auto;
    color: rgba(236, 168, 105, 0.4);
    stroke-width: 1.5;
}

.empty-state p {
    font-size: 1.125rem;
    color: #6b7280;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* ========================================
   ANIMATION DELAYS
   ======================================== */

.employee-card.fade-in {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.employee-card:nth-child(1) { animation-delay: 0.1s; }
.employee-card:nth-child(2) { animation-delay: 0.2s; }
.employee-card:nth-child(3) { animation-delay: 0.3s; }
.employee-card:nth-child(4) { animation-delay: 0.4s; }
.employee-card:nth-child(5) { animation-delay: 0.5s; }
.employee-card:nth-child(6) { animation-delay: 0.6s; }
.employee-card:nth-child(n+7) { animation-delay: 0.7s; }

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1200px) {
    .employee-level {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .org-header {
        padding: 2.5rem 1.5rem;
    }
    
    .org-title {
        font-size: 1.8rem;
    }
    
    .org-subtitle {
        font-size: 1rem;
    }
    
    .nav-buttons {
        justify-content: center;
        padding: 1.25rem 1rem;
        gap: 0.5rem;
    }
    
    .nav-btn {
        flex: 1;
        min-width: 140px;
        justify-content: center;
        font-size: 0.8125rem;
        padding: 0.625rem 1rem;
    }
    
    .employee-level {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .chart-content {
        padding: 2rem 1rem;
    }
    
    .department-header {
        margin-bottom: 2rem;
    }
}

@media (max-width: 480px) {
    .org-header {
        padding: 2rem 1rem;
    }
    
    .org-title {
        font-size: 1.5rem;
    }
    
    .nav-btn {
        width: 100%;
        min-width: auto;
    }
    
    .photo-container {
        height: 6rem;
    }
    
    .photo-wrapper {
        width: 4.5rem;
        height: 4.5rem;
    }
    
    .employee-name {
        font-size: 1rem;
        min-height: 2.5rem;
    }
    
    .employee-card {
        padding: 1.25rem;
    }
    
    .department-title {
        font-size: 1.25rem;
    }
    
    .count-number {
        font-size: 1.5rem;
    }
}

/* ========================================
   PRINT OPTIMIZATION
   ======================================== */

@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .nav-buttons,
    .org-header::before,
    .org-header::after {
        display: none !important;
    }
    
    .employee-card {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #d1d5db;
    }
    
    .employee-card::before {
        display: none;
    }
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}
