/* ========================================
   BASE STYLES & RESET
   ======================================== */

/* Reset problematic user agent styles */
* {
    box-sizing: border-box;
}

div {
    unicode-bidi: normal !important;
}

/* Force override for article sections */
.article-section-side,
.article-section-side > *,
[class*="most-liked"],
[class*="most-commented"] {
    unicode-bidi: normal !important;
    isolation: auto !important;
}

/* Ensure flex containers work properly */
.home-articles,
.article-section-side,
.compact-articles-grid,
[class*="flex"],
[style*="display: flex"],
[style*="display: grid"] {
    unicode-bidi: normal !important;
}

body {
    font-family: sans-serif;
    margin: 0;
    background-image: url('../images/watermark.png');
    background-size: 100vh;
    background-repeat: repeat;
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

.article-image {
    max-width: 100%;
    height: auto;
}

/* ========================================
   SCROLLBAR STYLES
   ======================================== */

/* WebKit Scrollbar Styles */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Thin scrollbar for specific elements */
.articleList::-webkit-scrollbar {
    width: 2px;
}

.articleList::-webkit-scrollbar-thumb {
    background: #aaa;
    border-radius: 1px;
}

/* ========================================
   LAYOUT & CONTAINER
   ======================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    width: 95%;
}



/* ========================================
   ANIMATIONS
   ======================================== */

.slideDown {
    animation: slideDown 0.3s ease-out forwards;
    opacity: 0;
    transform: translate(100px, -100px) scale(0.2);
}

@keyframes slideDown {
    to {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
}

.slide-up {
    animation: slideUp 0.5s ease-out forwards;
    opacity: 0;
    transform: translateY(50px);
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}






/* ========================================
   FORMS - GENERAL
   ======================================== */

/* Login Forms */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.login-form,
.login-box {
    background: white;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-form h2,
.login-box h2 {
    color: #333;
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

.login-form input,
.login-box input {
    width: 100%;
    padding: 0.75rem;
    margin: 0.5rem 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.login-form input:focus {
    outline: none;
    border-color: #555;
}

.login-form button,
 .login-box button {
    width: 100%;
    padding: 0.75rem;
    background: #333;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.login-form button:hover,
.login-box button:hover {
    background: #444;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}





/* ========================================
   INTERACTIVE ELEMENTS
   ======================================== */

/* Like System */
.like-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1em;
    padding: 0;
}

.like-btn:hover {
    transform: scale(1.1);
}

.liked {
    color: red;
    font-weight: bold;
}

/* Edit Buttons */
.edit-btn {
    background: #222;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.edit-btn:hover {
    background: #333;
}

.save-btn {
    background: var(--navy-blue);
    color: white;
}

.cancel-btn {
    background: #666;
    color: white;
}


/* ========================================
   MODAL DIALOGS
   ======================================== */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.3s ease;
    min-width: 300px;   /* make sure it's visible */
    max-width: 90%;     /* responsive */
    z-index: 1001;      /* above the dark overlay */
}

.modal.active {
    transform: translateY(0);
    opacity: 1;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-buttons button {
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-buttons .confirm-btn {
    background: #4CAF50;
    color: white;
}

.modal-buttons .cancel-btn {
    background: #f44336;
    color: white;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.error,
.login-error {
    background: #ffebee;
    color: #c62828;
    padding: 0.75rem;
    border-radius: 4px;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.success-message {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 1rem;
    margin: 1rem;
    border-radius: 4px;
    text-align: center;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 1rem;
    margin: 1rem;
    border-radius: 4px;
    text-align: center;
}

.edit-info {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    margin-top: 0.5rem;
}

small {
    color: #f0e9e9;
}




/* ========================================
   TAGS STYLES
   ======================================== */

.tags-area {
    display: flex;
    justify-content: center;
    padding: 10px;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: #f0f0f0;
    color: #333;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.tag:hover {
    background: maroon;
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.tag:active {
    transform: scale(0.95);
}

