/* ============================================
   Editorial Board Styles - Fully Corrected
   ============================================ */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box !important;
}

/* Font Face Declarations */
@font-face {
    font-family: DroidArabicKufi;
    src: url(/public/fonts/DroidKufi/DroidKufi-Regular.ttf) format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: DroidArabicKufi;
    src: url(/public/fonts/DroidKufi/DroidKufi-Bold.ttf) format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* CSS Variables */
:root {
    --space-xxs: 0.125rem;
    --space-xs: 0.25rem;
    --space-sm: 0.375rem;
    --space-md: 0.5rem;
    --space-lg: 0.75rem;
    --space-xl: 1rem;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition: all 0.15s ease;
    
    /* Policy Colors */
    --policy-blue: #2563eb;
    --policy-green: #059669;
    --policy-amber: #d97706;
    --policy-red: #dc2626;
    --policy-cyan: #0891b2;
    --policy-purple: #7c3aed;
    --policy-pink: #db2777;
    --policy-indigo: #4f46e5;
    --policy-teal: #0d9488;
    --policy-orange: #ea580c;
    --policy-gray-50: #f9fafb;
    --policy-gray-100: #f3f4f6;
    --policy-gray-200: #e5e7eb;
    --policy-gray-300: #d1d5db;
    --policy-gray-400: #9ca3af;
    --policy-gray-500: #6b7280;
    --policy-gray-600: #4b5563;
    --policy-gray-700: #374151;
    --policy-gray-800: #1f2937;
    --policy-gray-900: #111827;
    
    /* Metric Colors */
    --metric-blue: #2563eb;
    --metric-green: #059669;
    --metric-amber: #d97706;
    --metric-red: #dc2626;
    --metric-cyan: #0891b2;
    --metric-gray-50: #f9fafb;
    --metric-gray-100: #f3f4f6;
    --metric-gray-200: #e5e7eb;
    --metric-gray-300: #d1d5db;
    --metric-gray-400: #9ca3af;
    --metric-gray-500: #6b7280;
    --metric-gray-600: #4b5563;
    --metric-gray-700: #374151;
    --metric-gray-800: #1f2937;
    
    /* Theme Colors */
    --primary-dark: #0a1f33;
    --primary-medium: #123b5e;
    --primary-blue: #003366;
    --accent-primary: #f1c40f;
    --accent-secondary: #f39c12;
    --text-dark: #1e3a5f;
    --text-medium: #1f3a5f;
    --bg-light: #f9fcff;
    --border-light: #e2edff;
    --border-medium: #d9e8ff;
    
    /* Footer Colors */
    --footer-bg-start: #0a1f33;
    --footer-bg-end: #123b5e;
    --footer-accent: #f1c40f;
    --footer-accent-dark: #f39c12;
    --footer-text: #ffffff;
    --footer-text-dim: rgba(255, 255, 255, 0.85);
    --footer-bg-subtle: rgba(255, 255, 255, 0.03);
    --footer-bg-hover: rgba(255, 255, 255, 0.08);
    --footer-border: rgba(255, 255, 255, 0.1);
    --footer-shadow: rgba(0, 0, 0, 0.3);
    --footer-transition: all 0.3s ease;
}

/* HTML & Body Base */
html {
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden !important;
    text-size-adjust: 100%;
    font-kerning: normal;
    font-feature-settings: "liga", "kern";
    font-size: 14px;
}

body {
    line-height: 30px;
    letter-spacing: .01em;
    word-spacing: 0.01em;
    color: var(--metric-gray-700);
    background: linear-gradient(135deg, #f8fafc 0, #f1f5f9 100%);
    min-height: 100vh;
    font-size: 14px;
    font-weight: 400;
    font-family: DroidArabicKufi, "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

html, body {
    width: 100% !important;
    max-width: 100% !important;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: DroidArabicKufi, "Noto Sans", sans-serif;
    margin-top: 0;
    margin-bottom: 15px;
    color: inherit;
    font-weight: 600;
    line-height: 1.4;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

/* Section Title */
.section-title {
    position: relative;
    display: inline-block;
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f3b5e;
    margin: 0;
    text-transform: uppercase;
    overflow: hidden;
}

.section-title::after {
    content: "";
    position: absolute;
    bottom: -14px;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #f39c12, #f1c40f);
    border-radius: 3px;
}

/* Main Container */
.ojs-editorial-board-container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 2rem;
    background: #fff;
    border-radius: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
    color: #1e293b;
    line-height: 1.4;
    transition: 0.2s;
}

/* Editorial Sections */
.editorial-section {
    margin-bottom: 3rem;
}

.editorial-section:last-child {
    margin-bottom: 0;
}

/* Grid Systems */
.grid-auto {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-2 {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    margin-bottom: 16px;
}

.grid-3 {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    margin-bottom: 16px;
}

.grid-4 {
    display: grid;
    gap: 5px;
    margin: 0;
    padding: 0;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    margin-bottom: 16px;
}

.editorial-grid {
    display: grid;
    gap: clamp(12px, 2vw, 16px);
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Cards */
.card {
    position: relative;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    gap: 12px;
    transition: 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 8px 18px -6px rgba(0, 47, 91, 0.08);
    border-color: #cbddf5;
    transform: translateY(-3px);
}

.card-featured {
    background: linear-gradient(145deg, #f9fcff, #fff);
    border-left: 5px solid #2c7da0;
    grid-column: 1 / -1;
    padding: 16px;
}

.card-advisory {
    background: #fafdff;
    border-left: 3px solid #10b981;
}

/* Card Avatar */
.card-avatar {
    width: 58px;
    height: 58px;
    border-radius: 32px;
    background: #e1ecfe;
    color: #0b3b5c;
    font-weight: 600;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid #fff;
    box-shadow: 0 4px 10px rgba(0, 60, 130, 0.1);
    text-transform: uppercase;
}

.card-featured .card-avatar {
    width: 54px;
    height: 54px;
    font-size: 18px;
    background: #0f172a;
    color: #fff;
    border: 0;
}

.card-advisory .card-avatar {
    background: #ecfdf5;
    color: #166534;
    border-color: #bbf7d0;
}

/* Card Info */
.card-info {
    flex: 1;
    min-width: 0;
}

.card-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0d2b45;
    margin-bottom: 0.35rem;
    line-height: 1.4;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    word-break: break-word;
    text-overflow: ellipsis;
    overflow: hidden;
}

.card-featured .card-name {
    font-size: 16px;
}

.card-email {
    font-size: 11px;
    color: #1f68a7;
    background: #eef4fc;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.3rem 1rem;
    border-radius: 40px;
    margin: 0.5rem 0 0.6rem;
    border: 1px solid #cddef7;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    word-break: break-all;
}

.card-featured .card-email {
    font-size: 12px;
}

.card-affiliation {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 3px;
    line-height: 1.2;
    display: block;
    word-break: break-word;
}

/* Card Meta */
.card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 12px;
    margin-top: 1rem;
    width: 100%;
    border-top: 1px dashed #d5e2f0;
    padding-top: 0.8rem;
    font-size: 11px;
}

.card-country {
    font-size: 0.9rem;
    background: #f0f5fa;
    padding: 0.3rem 0.8rem;
    border-radius: 40px;
    color: #1c4e70;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #cbd5e1;
    font-weight: 500;
    white-space: nowrap;
}

.card-country::before {
    content: "\f0ac";
    font-family: "Font Awesome 6 Free";
    font-weight: 400;
    font-size: 0.8rem;
}

/* Card Actions */
.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.card-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 1px solid #b7d3f0;
    color: #1a4c7a;
    font-size: 0.85rem;
    padding: 0.35rem 0.9rem;
    border-radius: 40px;
    cursor: pointer;
    transition: 0.1s;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}

.card-btn:hover {
    background: #dbeafe;
    border-color: #1f68a7;
    color: #0a314b;
    box-shadow: 0 2px 4px rgba(2, 132, 199, 0.08);
}

.card-body {
    flex: 1;
}

/* Info Cards */
.info-card {
    background: #fff;
    border-radius: 14px;
    padding: 14px;
    border: 1px solid #e2edff;
    box-shadow: 0 4px 10px rgba(0, 30, 60, 0.06);
    transition: 0.2s;
}

.info-card:hover {
    transform: translateY(-2px);
    border-color: #f1c40f;
    box-shadow: 0 8px 16px rgba(0, 40, 70, 0.12);
}

.info-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #036;
    margin-bottom: 6px;
    border-inline-start: 3px solid #f39c12;
    padding-inline-start: 8px;
}

/* Animations */
@keyframes gentleShine {
    0% {
        transform: translateX(-100%) skewX(-15deg);
    }
    100% {
        transform: translateX(100%) skewX(-15deg);
    }
}

@keyframes subtleFadeIn {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(-4px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes modalPop {
    0% {
        opacity: 0.7;
        transform: scale(0.96);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* RTL Language Support */
html[dir="rtl"],
html[lang^="ar"] {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] body {
    font-family: DroidArabicKufi, "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6 {
    font-family: DroidArabicKufi, sans-serif;
    line-height: 1.2;
}

html[dir="rtl"] .section-title::after {
    left: auto;
    right: 0;
}

html[dir="rtl"] .info-card h3 {
    border-inline-start: none;
    border-inline-end: 3px solid #f39c12;
    padding-inline-start: 0;
    padding-inline-end: 8px;
}

/* LTR Language Support */
html[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

html[dir="ltr"] body {
    font-family: "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html[dir="ltr"] h1,
html[dir="ltr"] h2,
html[dir="ltr"] h3,
html[dir="ltr"] h4,
html[dir="ltr"] h5,
html[dir="ltr"] h6 {
    font-family: "Noto Sans", sans-serif;
    line-height: 1.2;
}

/* Modal Overlay */
.modal-overlay {
    display: none !important;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal-overlay.modal-show {
    display: flex !important;
}

.modal-card {
    background: #fff;
    width: 92%;
    max-width: 640px;
    max-height: 88vh;
    overflow-y: auto;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
    animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e9eef3;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border-radius: 50%;
    background: #f2f4f7;
    color: #667085;
    transition: 0.2s;
    cursor: pointer;
    border: none;
}

.modal-close:hover {
    background: #e7edf3;
    color: #1e6f9f;
    transform: rotate(90deg);
}

.modal-avatar-large {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e6f9f, #155a82);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
    border: 3px solid #cfe6ff;
    flex-shrink: 0;
}

.modal-name {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0a2540;
    margin-bottom: 2px;
}

.modal-sub {
    font-size: 0.95rem;
    color: #1e6f9f;
}

.modal-section {
    background: #f8fbff;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 14px;
    border: 1px solid #e6edf5;
}

.modal-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e6f9f;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.modal-section-title i {
    color: #f39c12;
}

.modal-detail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
    font-size: 0.92rem;
    color: #2b3e56;
}

.modal-detail-item i {
    width: 20px;
    color: #1e6f9f;
}

.academic-item {
    padding: 5px 0;
    border-bottom: 1px dashed #dde5ed;
    font-size: 0.9rem;
}

.academic-item:last-child {
    border-bottom: none;
}

.academic-item strong {
    color: #0f3b5e;
}

.research-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.research-tag {
    background: linear-gradient(135deg, #e4f2fb, #d7e9f8);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
    border: 1px solid #c9def2;
    color: #1a4c7a;
}

.publications-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.publications-list li {
    padding: 7px 0 7px 18px;
    border-bottom: 1px solid #e5edf5;
    font-size: 0.9rem;
    color: #2c3e50;
    position: relative;
}

.publications-list li::before {
    content: "•";
    position: absolute;
    left: 3px;
    top: 5px;
    color: #f39c12;
    font-size: 1.1rem;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e9eef3;
}

.modal-action-btn {
    flex: 1;
    padding: 9px 12px;
    border: none;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: 0.2s;
}

.modal-action-btn:first-child {
    background: #1e6f9f;
    color: #fff;
}

.modal-action-btn:first-child:hover {
    background: #155a82;
    transform: translateY(-1px);
}

.modal-action-btn:last-child {
    background: #e9f1fa;
    color: #1e6f9f;
    border: 1px solid #c9def2;
}

.modal-action-btn:last-child:hover {
    background: #dceaf7;
}

/* Hide OJS Default Elements */
div[class*="current-issue"] {
    display: none !important;
}

/* RTL Modal Adjustments */
html[dir="rtl"] .modal-close {
    right: auto;
    left: 14px;
}

html[dir="rtl"] .modal-detail-item,
html[dir="rtl"] .modal-header {
    flex-direction: row-reverse;
}

html[dir="rtl"] .publications-list li {
    padding-right: 18px;
    padding-left: 0;
}

html[dir="rtl"] .publications-list li::before {
    right: 3px;
    left: auto;
}

/* Print Styles */
@media print {
    body {
        background: #fff;
        padding: 0;
    }
    
    .card-btn,
    .modal-actions,
    .card-actions {
        display: none;
    }
    
    .card {
        break-inside: avoid;
        border: 1px solid #ccc;
    }
}

/* Responsive Design */
@media (max-width: 900px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    body {
        line-height: 26px;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.125rem; }
    
    .section-title {
        font-size: 1.2rem;
    }
    
    .section-title::after {
        width: 40px;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .card {
        flex-direction: column;
    }
    
    .card-avatar {
        margin-bottom: 10px;
    }
    
    .modal-card {
        padding: 16px;
    }
    
    .modal-header {
        flex-direction: column;
        text-align: center;
    }
    
    .modal-avatar-large {
        margin-bottom: 6px;
    }
    
    .modal-detail-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .modal-actions {
        flex-direction: column;
    }
}

@media (max-width: 767px) {
    .section-title {
        font-size: 18px !important;
    }
}

@media (max-width: 640px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    body {
        padding: var(--space-sm);
        align-items: flex-start;
    }
    
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.125rem; }
}

@media (max-width: 400px) {
    .card {
        flex-wrap: wrap;
    }
    
    .card-avatar {
        margin-bottom: 2px;
    }
    
    .card-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .card-actions {
        width: 100%;
    }
    
    .card-btn {
        flex: 1 1 auto;
        justify-content: center;
    }
}

@media (max-width: 380px) {
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 360px) {
    .section-title {
        font-size: 18px !important;
    }
}