/*
 * Shared site styles for ISOC Portal
 * Placed in assets/css/style.css and referenced by site pages.
 * Bootstrap is also included in the HTML via CDN for layout/utilities.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header (public site) */
.header {
    background: #173e52;
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-shrink: 0; /* Don't shrink header */
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    text-decoration: none;
    color: white;
}

.header-left {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.language-switcher { 
    display: flex; 
    gap: 10px; 
}
.lang-btn, .lang-btn:link, .lang-btn:visited{
    padding: 8px 16px;
    border: 2px solid rgba(255,255,255,0.3);
    background: transparent;
    color: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
}
.lang-btn.active{ background: rgba(255,255,255,0.2); border-color: white; }
.lang-btn:hover{ background: rgba(255,255,255,0.2); transform: translateY(-2px); text-decoration: none; color: white; }

/* Navigation */
.nav { 
    background: white; 
    padding: 15px 0; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
    z-index: 999;
    flex-shrink: 0; /* Don't shrink nav */
}
.nav-menu { display:flex; list-style:none; gap:20px; flex-wrap: wrap; padding: 0; margin: 0; }
.nav-menu li { list-style: none; }
.nav-menu a{ color:#333; text-decoration:none; font-weight:500; padding:10px 15px; border-bottom:2px solid transparent; transition: all 0.3s ease; white-space: nowrap; display: block; }
.nav-menu a:hover, .nav-menu a.active{ color:#173e52; border-bottom-color:#173e52; }

/* Page sections */
.page-section{ padding:60px 0; }
.page-section h2{ font-size:32px; font-weight:600; text-align:center; margin-bottom:40px; color:#2c3e50; }

.page-content{ background:white; border-radius:15px; padding:40px; box-shadow:0 5px 20px rgba(0,0,0,0.1); margin-bottom:30px; }

.contact-form{ max-width:600px; margin:0 auto; }
.form-group{ margin-bottom:20px; }
.form-group label{ display:block; margin-bottom:8px; font-weight:500; color:#2c3e50; }
.form-group input, .form-group textarea{ width:100%; padding:12px 16px; border:2px solid #e9ecef; border-radius:8px; font-size:16px; transition: all 0.3s ease; }
.form-group input:focus, .form-group textarea:focus{ border-color:#173e52; box-shadow: 0 0 0 3px rgba(23,62,82,0.1); outline:none; }

.btn-custom{ background: #173e52; color:white; padding:12px 30px; border:none; border-radius:25px; font-size:16px; font-weight:500; cursor:pointer; transition:all 0.3s ease; }
.btn-custom:hover{ transform: translateY(-2px); box-shadow: 0 5px 15px rgba(23,62,82,0.3); background: #1a4a65; }

/* Hero */
.hero{ 
    background: #173e52; 
    color:white; 
    padding:80px 0; 
    text-align:center; 
    flex-shrink: 0; /* Don't shrink hero */
}
.hero h1{ font-size:48px; font-weight:700; margin-bottom:20px; }
.hero p{ font-size:20px; opacity:0.9; max-width:600px; margin:0 auto; }

/* Main content */
.main-content{ 
    padding:60px 0; 
    flex: 1 0 auto; /* Grow to fill available space, push footer down */
}
.section-title{ font-size:32px; font-weight:600; text-align:center; margin-bottom:50px; color:#2c3e50; }

/* News grid */
.news-grid{ display:grid; grid-template-columns: repeat(auto-fit, minmax(350px,1fr)); gap:30px; margin-bottom:60px; }
.news-card{ background:white; border-radius:15px; overflow:hidden; box-shadow:0 5px 20px rgba(0,0,0,0.1); transition: all 0.3s ease; }
.news-card:hover{ transform: translateY(-10px); box-shadow: 0 15px 40px rgba(0,0,0,0.15); }
a.news-card { text-decoration: none; color: inherit; display: block; }

/* Pagination */
.pagination-container {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pagination-btn, .pagination-number {
    padding: 10px 16px;
    border: 2px solid #e9ecef;
    background: white;
    color: #173e52;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.pagination-btn:hover:not(.disabled), .pagination-number:hover {
    background: #173e52;
    color: white;
    border-color: #173e52;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(23, 62, 82, 0.2);
}

.pagination-number.active {
    background: #173e52;
    color: white;
    border-color: #173e52;
    cursor: default;
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-ellipsis {
    padding: 10px 8px;
    color: #7f8c8d;
    display: inline-flex;
    align-items: center;
}

.pagination-info {
    text-align: center;
    margin-top: 0;
    color: #7f8c8d;
    font-size: 14px;
    white-space: nowrap;
}

/* Dashboard pagination styles */
.dashboard .pagination-container {
    margin-top: 30px;
    margin-bottom: 20px;
}

.dashboard .pagination-btn,
.dashboard .pagination-number {
    min-width: 40px;
    height: 36px;
    padding: 6px 12px;
    font-size: 14px;
}

.dashboard .pagination-info {
    font-size: 13px;
}
.news-image{ height:200px; background: #173e52; display:flex; align-items:center; justify-content:center; color:white; font-size:48px; }
.news-content{ padding:25px; }
.news-meta{ color:#7f8c8d; font-size:14px; margin-bottom:15px; display:flex; align-items:center; gap:20px; }
.news-meta i{ margin-right:5px; }
.news-title{ font-size:20px; font-weight:600; color:#2c3e50; margin-bottom:15px; line-height:1.4; }
.news-excerpt{ color:#555; line-height:1.6; margin-bottom:20px; }
.read-more{ color:#173e52; text-decoration:none; font-weight:500; display:inline-flex; align-items:center; gap:5px; transition:all 0.3s ease; }
.read-more:hover{ color:#1a4a65; transform: translateX(5px); }

/* Stats */
.stats-section{ background:white; padding:60px 0; margin:60px 0; border-radius:20px; box-shadow:0 5px 20px rgba(0,0,0,0.1); }
.stats-grid{ display:grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap:30px; }
.stat-item{ text-align:center; padding:30px; }
.stat-number{ font-size:48px; font-weight:700; color:#173e52; margin-bottom:10px; }
.stat-label{ color:#7f8c8d; font-size:16px; font-weight:500; }

.footer{ 
    background:#173e52; 
    color:white; 
    padding:40px 0; 
    text-align:center; 
    flex-shrink: 0; /* Don't shrink footer */
    margin-top: auto; /* Push footer to bottom */
}
.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.footer p{ opacity:0.8; margin: 0; }
.social-media {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
}
.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 18px;
}
.social-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
    color: white;
    text-decoration: none;
}

.loading{ text-align:center; padding:60px; color:#7f8c8d; }
.loading i{ font-size:32px; animation: spin 1s linear infinite; }
@keyframes spin{ 0%{ transform: rotate(0deg);} 100%{ transform: rotate(360deg);} }

.rtl{ direction: rtl; }
.rtl .nav-menu{ flex-direction: row-reverse; }
.rtl .news-meta{ flex-direction: row-reverse; }
.rtl .read-more{ flex-direction: row-reverse; }

@media (max-width: 768px){
    .header-content{ flex-direction: column; gap:20px; }
    .nav-menu{ flex-direction: column; gap:10px; text-align:center; }
    .hero h1{ font-size:32px; }
    .hero p{ font-size:16px; }
    .news-grid{ grid-template-columns: 1fr; }
    .stats-grid{ grid-template-columns: repeat(2,1fr); }
}

/* Dashboard specific overrides */
body.dashboard-bg{ background: #173e52; min-height:100vh; }
.dashboard .container{ padding:20px; }
.dashboard .header{ 
    background: rgba(255,255,255,0.95); 
    backdrop-filter: blur(10px); 
    border-radius:20px; 
    padding:20px 30px; 
    margin-bottom:30px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.1); 
    display:flex; 
    justify-content:space-between; 
    align-items:center; 
    flex-wrap: wrap;
    gap: 15px;
}
.dashboard .logo{ color:#2c3e50; }
.dashboard .lang-btn, .dashboard .lang-btn:link, .dashboard .lang-btn:visited{ border:2px solid #173e52; color:#173e52; text-decoration: none; }
.dashboard .lang-btn.active{ background:#173e52; color:white; }
.dashboard .lang-btn:hover{ background:#173e52; color:white; text-decoration: none; }
.dashboard{ display:grid; grid-template-columns:300px 1fr; gap:30px; min-height:70vh; }
.dashboard .sidebar{ background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); border-radius:20px; padding:30px; box-shadow:0 10px 30px rgba(0,0,0,0.1); }
.dashboard .nav-menu{ display:flex; flex-direction:column; gap:12px; list-style:none; padding:0; }
.dashboard .sidebar .nav-menu{ display:flex !important; flex-direction:column !important; gap:12px !important; list-style:none !important; padding:0 !important; margin:0 !important; }
.dashboard .nav-menu a{ display:flex; align-items:center; padding:12px 16px; color:#7f8c8d; text-decoration:none; border-radius:10px; }
.dashboard .nav-menu a:hover, .dashboard .nav-menu a.active{ background:#173e52; color:white; transform: translateX(5px); }
.dashboard .main-content{ background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); border-radius:20px; padding:30px; box-shadow:0 10px 30px rgba(0,0,0,0.1); position: relative; z-index: 1; }
.dashboard .stat-card{ background: #173e52; color:white; padding:25px; border-radius:15px; text-align:center; }
.dashboard .news-card{ 
    background:white; 
    border-radius:15px; 
    padding:25px; 
    box-shadow:0 5px 15px rgba(0,0,0,0.1); 
    border-left:4px solid #173e52; 
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.dashboard .news-card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.dashboard #posts-container .news-card:last-child {
    margin-bottom: 0;
}
.dashboard .content-section{ 
    display: block !important; 
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
}
.dashboard .main-content .content-section {
    display: block !important;
}

/* Make sidebar sticky in desktop layouts */
.dashboard .sidebar{ position: -webkit-sticky; position: sticky; top: 30px; align-self: start; }

/* Mobile: hide sidebar by default and provide a slide-in panel */
@media (max-width: 767px){
    .dashboard{ display:block; }
    .dashboard .header {
        padding: 15px 20px;
        flex-direction: column;
        align-items: flex-start;
    }
    .dashboard .header-left {
        width: 100%;
        justify-content: space-between;
    }
    .dashboard .header-right {
        width: 100%;
        justify-content: space-between;
        margin-top: 10px;
        padding-top: 15px;
        border-top: 1px solid rgba(23, 62, 82, 0.1);
    }
    .dashboard .language-switcher {
        order: 2;
    }
    .dashboard .user-area {
        order: 1;
        width: 100%;
        justify-content: flex-end;
    }
    .dashboard .sidebar{ display:none; }
    .dashboard.sidebar-open .sidebar{
        display:block;
        position:fixed;
        left:0; top:0;
        height:100vh;
        width:280px;
        padding:80px 20px 20px 20px;
        z-index:1050;
        box-shadow: 2px 0 20px rgba(0,0,0,0.2);
        border-radius:0 12px 12px 0;
        overflow-y:auto;
        background: rgba(255,255,255,0.98);
    }
    .dashboard.sidebar-open .main-content{
        filter: blur(1px);
        pointer-events: none;
        user-select: none;
    }
}

/* overlay used when mobile sidebar is open */
.dashboard-overlay{ position:fixed; left:0; top:0; right:0; bottom:0; background:rgba(0,0,0,0.35); z-index:1040; }
.dashboard-overlay.d-none{ display:none; }

/* Section settings panel inside content sections */
.section-header{ margin-bottom:12px; }
.section-settings{ background:#f1f5f9; border:1px solid #e2e8f0; padding:12px; border-radius:8px; margin-bottom:16px; }
.section-settings label{ font-size:13px; margin-bottom:6px; display:block; }
.section-settings .form-control-sm, .section-settings .form-select-sm{ max-width:220px; }

/* Small helpers moved from inline */
.features-list{ margin:20px 0; padding-left:20px; }
#form-message{ margin-top:20px; padding:15px; border-radius:8px; display:none; }

/* small content wrapper previously inline */
.content-wrapper{ max-width:800px; margin:0 auto; }

/* Bootstrap modal fix for dashboard */
.dashboard .modal-backdrop {
    z-index: 1050;
}
.dashboard .modal {
    z-index: 1055;
}

/* Post status indicators */
.dashboard .status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
}

.dashboard .news-card .status-indicator {
    margin-top: 2px;
}

.dashboard .news-card .badge {
    font-size: 11px;
    font-weight: normal;
    padding: 4px 8px;
    border-radius: 4px;
}

/* end of stylesheet */
