/* ========================================
   Modern Post Styles for Arabic & English
   Host Libya Blog Posts
   ======================================== */

/* ===== Base Styles ===== */
.post-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Hero Section ===== */
.post-hero {
    text-align: center;
    padding: 60px 0;
    background: #ff8c00; /* Orange background */
    margin-bottom: 50px;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    animation: fadeInDown 1s ease-out;
    border: 3px dotted #000; /* Black dotted border */
}

.post-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
    animation: float 6s ease-in-out infinite;
}

/* ===== Topic Badge ===== */
.topic-badge-large {
    background: #ff8c00;
    color: black;
    padding: 20px 40px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    font-weight: bold;
    font-size: 24px;
    box-shadow: 0 10px 30px rgba(255,107,53,0.3);
    position: relative;
    z-index: 2;
    margin-bottom: 20px;
    animation: bounceIn 1.2s ease-out;
    border: 2px solid black;
}

.topic-badge-large i {
    font-size: 28px;
    animation: pulse 2s infinite;
}

/* ===== Post Title ===== */
.post-title {
    color: black;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    text-shadow: none;
    animation: fadeInUp 1.5s ease-out;
}

.post-subtitle {
    color: black;
    font-size: 1.2rem;
    margin-top: 15px;
    animation: fadeInUp 1.8s ease-out;
}

/* ===== Post Content ===== */
.post-content {
    background: white;
    border-radius: 20px;
    padding: 50px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    margin-bottom: 40px;
    animation: fadeInUp 2s ease-out;
    position: relative;
}

.post-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #ff6b35, #f7931e, #667eea, #764ba2);
    border-radius: 20px 20px 0 0;
}

/* ===== Post Meta ===== */
.post-meta {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    animation: slideInUp 2.2s ease-out;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
}

.meta-item i {
    color: #ff6b35;
    font-size: 16px;
}

/* ===== Post Body Typography ===== */
.post-body h2 {
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 600;
    margin: 40px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 3px solid #ff6b35;
    position: relative;
    animation: slideInRight 0.8s ease-out;
}

.post-body h3 {
    color: #34495e;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 30px 0 15px 0;
    animation: slideInLeft 0.8s ease-out;
}

.post-body p {
    line-height: 1.8;
    color: #555;
    margin-bottom: 20px;
    font-size: 16px;
    animation: fadeIn 1s ease-out;
}

.post-body ul, .post-body ol {
    margin: 20px 0;
    padding-right: 20px;
}

.post-body li {
    margin-bottom: 10px;
    line-height: 1.6;
    color: #555;
    animation: slideInUp 0.6s ease-out;
}

/* ===== Alert Boxes ===== */
.alert {
    border: none;
    border-radius: 15px;
    padding: 25px;
    margin: 30px 0;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    animation: zoomIn 0.8s ease-out;
}

.alert-info {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-left: 5px solid #2196f3;
}

.alert-success {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    border-left: 5px solid #4caf50;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3e0, #ffcc02);
    border-left: 5px solid #ff9800;
}

.alert h5 {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 15px;
}

/* ===== Post Navigation ===== */
.post-navigation {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    animation: slideInUp 2.5s ease-out;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.btn-outline-primary {
    border: 2px solid #ff6b35;
    color: #ff6b35;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 200px;
    font-size: 16px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-outline-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: #ff6b35;
    transition: all 0.3s ease;
    z-index: -1;
}

.btn-outline-primary:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,107,53,0.3);
}

.btn-outline-primary:hover::before {
    width: 100%;
}

/* ===== RTL Support for Arabic ===== */
[dir="rtl"] .post-body ul, 
[dir="rtl"] .post-body ol {
    padding-right: 20px;
    padding-left: 0;
}

[dir="rtl"] .meta-item {
    flex-direction: row-reverse;
}

[dir="rtl"] .topic-badge-large {
    flex-direction: row-reverse;
}

/* ===== LTR Support for English ===== */
[dir="ltr"] .post-body ul, 
[dir="ltr"] .post-body ol {
    padding-left: 20px;
    padding-right: 0;
}

[dir="ltr"] .alert {
    border-left: 5px solid;
    border-right: none;
}

[dir="rtl"] .alert {
    border-right: 5px solid;
    border-left: none;
}

/* ===== Animations ===== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ===== Enhanced Typography ===== */
.post-body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.post-body strong {
    color: #2c3e50;
    font-weight: 600;
}

.post-body em {
    color: #7f8c8d;
    font-style: italic;
}

.post-body code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #e74c3c;
    font-size: 0.9em;
}

.post-body blockquote {
    border-left: 4px solid #ff6b35;
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: #7f8c8d;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

[dir="rtl"] .post-body blockquote {
    border-left: none;
    border-right: 4px solid #ff6b35;
    padding-left: 0;
    padding-right: 20px;
}

/* ===== Enhanced Lists ===== */
.post-body ul li::marker {
    color: #ff6b35;
}

.post-body ol li::marker {
    color: #ff6b35;
    font-weight: bold;
}

/* ===== Image Styles ===== */
.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    margin: 20px 0;
    transition: transform 0.3s ease;
}

.post-body img:hover {
    transform: scale(1.02);
}

/* ===== Table Styles ===== */
.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.post-body th,
.post-body td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

[dir="rtl"] .post-body th,
[dir="rtl"] .post-body td {
    text-align: right;
}

.post-body th {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    font-weight: 600;
}

.post-body tr:hover {
    background: #f8f9fa;
}

/* ===== Social Share Buttons ===== */
.social-share {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    margin: 30px 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.social-share h5 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    margin: 5px 0;
    border-radius: 25px;
    text-decoration: none;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 180px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.social-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: rgba(255,255,255,0.1);
    transition: all 0.3s ease;
    z-index: -1;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.social-btn:hover::before {
    width: 100%;
}

.social-btn.facebook {
    background: #3b5998;
}

.social-btn.twitter {
    background: #1da1f2;
}

.social-btn.linkedin {
    background: #0077b5;
}

.social-btn.whatsapp {
    background: #25d366;
}

/* ===== Reading Progress Bar ===== */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, #ff6b35, #f7931e);
    z-index: 9999;
    transition: width 0.3s ease;
}

/* ===== Back to Top Button ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255,107,53,0.3);
}

[dir="rtl"] .back-to-top {
    right: auto;
    left: 30px;
}

/* ===== Enhanced Responsive Design ===== */
@media (max-width: 1200px) {
    .post-container {
        max-width: 800px;
    }
    
    .btn-outline-primary {
        min-width: 180px;
        padding: 10px 20px;
    }
    
    .social-btn {
        min-width: 160px;
        padding: 8px 16px;
    }
}

@media (max-width: 992px) {
    .post-container {
        max-width: 700px;
        padding: 0 20px;
    }

    .post-content {
        padding: 40px 30px;
    }

    .post-title {
        font-size: 2.2rem;
    }
    
    .btn-outline-primary {
        min-width: 160px;
        font-size: 15px;
    }
    
    .social-btn {
        min-width: 140px;
        font-size: 14px;
    }
}

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

    .post-hero {
        padding: 40px 20px;
        margin-bottom: 30px;
        border-radius: 15px;
    }

    .topic-badge-large {
        padding: 15px 30px;
        font-size: 20px;
        gap: 10px;
    }

    .topic-badge-large i {
        font-size: 24px;
    }

    .post-title {
        font-size: 2rem;
        line-height: 1.2;
    }

    .post-subtitle {
        font-size: 1.1rem;
    }

    .post-content {
        padding: 30px 25px;
        border-radius: 15px;
    }

    .post-meta {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 15px;
    }

    .post-body h2 {
        font-size: 1.5rem;
        margin: 30px 0 15px 0;
    }

    .post-body h3 {
        font-size: 1.2rem;
        margin: 25px 0 12px 0;
    }

    .post-body p {
        font-size: 15px;
        line-height: 1.7;
    }

    .alert {
        padding: 20px 15px;
        margin: 20px 0;
    }

    .post-navigation {
        padding: 20px 15px;
        gap: 12px;
    }

    .btn-outline-primary {
        padding: 10px 20px;
        font-size: 14px;
        min-width: 140px;
    }

    .social-share {
        padding: 15px;
        gap: 8px;
    }

    .social-btn {
        padding: 8px 15px;
        font-size: 14px;
        min-width: 120px;
        margin: 3px 0;
    }

    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
        font-size: 16px;
    }

    [dir="rtl"] .back-to-top {
        right: auto;
        left: 20px;
    }
}

@media (max-width: 576px) {
    .post-hero {
        padding: 30px 15px;
        margin-bottom: 25px;
    }

    .topic-badge-large {
        padding: 12px 25px;
        font-size: 18px;
        flex-direction: column;
        gap: 8px;
    }

    .post-title {
        font-size: 1.8rem;
    }

    .post-content {
        padding: 25px 20px;
    }

    .post-body h2 {
        font-size: 1.3rem;
    }

    .post-body h3 {
        font-size: 1.1rem;
    }

    .post-body p {
        font-size: 14px;
    }

    .post-meta {
        padding: 12px;
    }

    .meta-item {
        font-size: 13px;
    }

    .alert {
        padding: 15px 12px;
    }

    .post-navigation {
        padding: 15px 12px;
        gap: 10px;
    }

    .btn-outline-primary {
        padding: 8px 15px;
        font-size: 13px;
        min-width: 120px;
    }

    .social-share {
        padding: 12px;
        gap: 6px;
    }

    .social-btn {
        padding: 6px 12px;
        font-size: 13px;
        min-width: 100px;
        margin: 2px 0;
    }
}

/* ===== Print Styles ===== */
@media print {
    .post-hero {
        background: none !important;
        color: #000 !important;
    }

    .topic-badge-large {
        background: none !important;
        color: #000 !important;
        border: 2px solid #000;
    }

    .post-title,
    .post-subtitle {
        color: #000 !important;
    }

    .post-content {
        box-shadow: none !important;
        border: 1px solid #ddd;
    }

    .post-navigation,
    .social-share,
    .back-to-top,
    .reading-progress {
        display: none !important;
    }

    .alert {
        border: 1px solid #ddd !important;
        background: #f9f9f9 !important;
    }

    .post-body img {
        box-shadow: none !important;
    }
}

/* ===== Dark Mode Support ===== */
@media (prefers-color-scheme: dark) {
    .post-content {
        background: #1a1a1a;
        color: #e0e0e0;
    }

    .post-body h2,
    .post-body h3 {
        color: #ffffff;
    }

    .post-body p,
    .post-body li {
        color: #cccccc;
    }

    .post-meta {
        background: #2a2a2a;
    }

    .meta-item {
        color: #999999;
    }

    .alert {
        background: #2a2a2a;
        color: #e0e0e0;
    }

    .alert h5 {
        color: #ffffff;
    }

    .post-navigation {
        background: #1a1a1a;
    }

    .social-share {
        background: #2a2a2a;
    }

    .post-body code {
        background: #2a2a2a;
        color: #ff6b35;
    }

    .post-body blockquote {
        background: #2a2a2a;
        color: #cccccc;
    }

    .post-body table {
        background: #1a1a1a;
    }

    .post-body th {
        background: linear-gradient(135deg, #ff6b35, #f7931e);
    }

    .post-body tr:hover {
        background: #2a2a2a;
    }
}
