/* ========================================
   Armamentse.com News - Styles
   ======================================== */

/* CSS Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.6;
    color: #1a1a1a;
    background-color: #f8f5f2;
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   Header & Navigation
   ======================================== */

.site-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
    padding: 15px 0;
    position: relative;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.logo .tagline {
    font-size: 0.85rem;
    opacity: 0.9;
    font-style: italic;
}

.main-nav {
    flex: 1;
    margin-left: 40px;
}

.nav-list {
    display: flex;
    list-style: none;
    flex-wrap: wrap;
    gap: 5px;
}

.nav-item {
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.nav-item.active {
    background-color: rgba(255, 255, 255, 0.3);
    font-weight: 600;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: #fff;
    transition: all 0.3s ease;
}

/* ========================================
   Ad Banners
   ======================================== */

.ad-banner {
    padding: 15px 0;
    background-color: #f0ebe3;
}

.ad-slot {
    max-width: 728px;
    margin: 0 auto;
    background-color: #e8e4dc;
    border: 1px dashed #ccc;
    padding: 10px;
    text-align: center;
    position: relative;
}

.ad-slot.vertical {
    max-width: 300px;
    min-height: 250px;
}

.ad-label {
    font-size: 0.7rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 5px;
}

.ad-content {
    background-color: #d8d4cc;
    padding: 40px 20px;
    color: #666;
    font-size: 0.9rem;
}

/* ========================================
   Main Content
   ======================================== */

.main-content {
    padding: 30px 0;
    animation: fadeIn 0.6s ease-out;
}

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

.content-wrapper {
    display: flex;
    gap: 30px;
}

.news-section {
    flex: 1;
    min-width: 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 3px solid #1e3c72;
    padding-bottom: 10px;
}

.section-title {
    font-size: 1.8rem;
    color: #1e3c72;
    font-weight: 700;
}

.loading-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #666;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top-color: #1e3c72;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   News Grid
   ======================================== */

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.news-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    animation: scaleIn 0.4s ease-out backwards;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.news-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.news-item:nth-child(1) { animation-delay: 0.05s; }
.news-item:nth-child(2) { animation-delay: 0.1s; }
.news-item:nth-child(3) { animation-delay: 0.15s; }
.news-item:nth-child(4) { animation-delay: 0.2s; }
.news-item:nth-child(5) { animation-delay: 0.25s; }
.news-item:nth-child(6) { animation-delay: 0.3s; }

.news-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background-color: #e8e4dc;
}

.news-image-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 3rem;
}

.news-content {
    padding: 18px;
}

.news-source {
    font-size: 0.75rem;
    color: #1e3c72;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.news-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #888;
}

.news-time {
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.news-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.news-tag {
    background-color: #f0ebe3;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.7rem;
    color: #666;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

/* ========================================
   Pagination
   ======================================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination-btn {
    padding: 10px 20px;
    background-color: #1e3c72;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    background-color: #2a5298;
}

.pagination-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 5px;
}

.page-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    transition: all 0.3s ease;
}

.page-number:hover {
    background-color: #f0ebe3;
}

.page-number.active {
    background-color: #1e3c72;
    color: #fff;
}

/* ========================================
   Sidebar
   ======================================== */

.sidebar {
    width: 320px;
    flex-shrink: 0;
}

.sidebar-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.sidebar-section h3 {
    font-size: 1.2rem;
    color: #1e3c72;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0ebe3;
}

.sidebar-ad {
    margin-bottom: 20px;
}

.trending-list {
    list-style: none;
}

.trending-list li {
    padding: 10px 0;
    border-bottom: 1px solid #f0ebe3;
}

.trending-list li:last-child {
    border-bottom: none;
}

.trending-list a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.3s ease;
}

.trending-list a:hover {
    color: #1e3c72;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.newsletter-form input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.newsletter-form button {
    padding: 12px;
    background-color: #1e3c72;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    transition: background-color 0.3s ease;
}

.newsletter-form button:hover {
    background-color: #2a5298;
}

/* ========================================
   Detail Modal (Iframe)
   ======================================== */

.detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.detail-modal.active {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease-out;
}

.modal-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    max-width: 100%;
    /* max-width: 900px; */
    /* max-height: 90vh; */
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlide 0.4s ease-out;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #1e3c72;
    color: #fff;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.share-btn,
.close-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 5px 10px;
    font-size: 0.9rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.share-btn:hover,
.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-ad {
    padding: 10px;
    background-color: #f0ebe3;
    text-align: center;
}

.modal-content {
    flex: 1;
    position: relative;
    min-height: 400px;
}

.iframe-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f8f5f2;
    z-index: 1;
}

.iframe-loader .spinner {
    width: 40px;
    height: 40px;
    border-width: 3px;
}

.iframe-loader p {
    margin-top: 15px;
    color: #666;
}

.iframe-loader.hidden {
    display: none;
}

#news-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.modal-footer {
    padding: 15px 20px;
    background-color: #f8f5f2;
    border-top: 1px solid #e8e4dc;
}

.share-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.share-option {
    padding: 8px 16px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    transition: all 0.3s ease;
}

.share-option:hover {
    background-color: #1e3c72;
    color: #fff;
    border-color: #1e3c72;
}

/* ========================================
   Footer
   ======================================== */

.site-footer {
    background-color: #1a1a1a;
    color: #fff;
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h4 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: #fff;
    border-bottom: 2px solid #1e3c72;
    padding-bottom: 8px;
}

.footer-section p {
    font-size: 0.9rem;
    color: #aaa;
    line-height: 1.6;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: #aaa;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #fff;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background-color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.social-links a:hover {
    background-color: #1e3c72;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #333;
}

.footer-bottom p {
    font-size: 0.85rem;
    color: #888;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 992px) {
    .content-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .news-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
        width: 100%;
        margin-left: 0;
        margin-top: 15px;
    }

    .main-nav.active {
        display: block;
    }

    .nav-list {
        flex-direction: column;
        width: 100%;
    }

    .nav-item {
        padding: 12px 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .header-inner {
        flex-wrap: wrap;
    }

    .logo {
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .modal-container {
        /* width: 95%;
        max-height: 95vh; */
    }

    .modal-title {
        font-size: 0.9rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .ad-content {
        padding: 20px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .pagination-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
}

/* ========================================
   IE8+ Compatibility
   ======================================== */

/* IE8 doesn't support flexbox or grid, fallback to floats */
.ie8 .content-wrapper,
.ie8 .header-inner,
.ie8 .modal-header {
    zoom: 1;
}

.ie8 .news-grid {
    display: block;
}

.ie8 .news-item {
    float: left;
    width: 31%;
    margin-right: 2%;
    margin-bottom: 20px;
}

.ie8 .news-item:nth-child(3n) {
    margin-right: 0;
}

/* Clearfix for IE */
.clearfix:before,
.clearfix:after {
    content: "";
    display: table;
}

.clearfix:after {
    clear: both;
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .ad-banner,
    .sidebar,
    .pagination,
    .detail-modal,
    .site-footer {
        display: none !important;
    }

    .news-item {
        page-break-inside: avoid;
    }
}

/* ========================================
   Utility Classes
   ======================================== */

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }

.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
