/* --- Main Article Page Layout --- */
.article-page-content {
    padding: 3rem 5%;
}

.article-header {
    text-align: center;
    margin-bottom: 3rem;
}

.article-header h1 {
    font-size: 2.8rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.dark-mode .article-header h1 {
    color: #a5d6a7;
}

.article-header p {
    font-size: 1.1rem;
    color: var(--text-color);
    opacity: 0.8;
    max-width: 600px;
    margin: 0 auto;
}

/* --- Article Grid --- */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

/* --- Article Card Styling --- */
.article-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.5s ease-out forwards;
}

.article-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card-link:hover .article-card {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
}

.dark-mode .article-card-link:hover .article-card {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
}

.article-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.article-card-link:hover .article-image {
    transform: scale(1.05);
}

.article-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    position: relative;
}

.article-author-avatar {
    position: absolute;
    top: -25px;
    right: 1.5rem;
    border: 3px solid var(--card-bg);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.article-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-card-link:hover .article-author-avatar {
    transform: scale(1.1);
}

.article-category {
    background-color: var(--accent-color);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    align-self: flex-start;
    margin-bottom: 1rem;
}

.article-title {
    font-size: 1.4rem;
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.dark-mode .article-title {
    color: #c9d1d9;
}

.article-excerpt {
    color: var(--text-color);
    opacity: 0.9;
    line-height: 1.6;
    flex-grow: 1;
    margin-bottom: 1rem;
}

.article-stats {
    display: flex;
    gap: 1rem;
    color: var(--text-color);
    opacity: 0.7;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.article-stats i {
    margin-right: 0.3rem;
}

.article-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.author-name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
}

.article-date {
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.7;
}

.share-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 5; /* Keep it above other elements in the card */
}

.article-card-link:hover .share-btn {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    transform: rotate(360deg);
}

/* --- Add Article Floating Button --- */
.add-article-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 999;
    text-decoration: none;
}

.add-article-btn:hover {
    background-color: #358a38;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* --- Share Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px;
    transform: scale(0.95);
    transition: transform 0.3s ease;
    text-align: center; /* Center content */
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.modal-header h3 {
    margin: 0;
    color: var(--secondary-color);
}

.dark-mode .modal-header h3 {
    color: #a5d6a7;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-color);
    opacity: 0.7;
}

.modal-body p {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.share-links {
    display: flex;
    justify-content: center; /* Center the icons */
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.share-link {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.share-links a i {
    color: white;   /* Force white color */
    font-size: 18px; /* adjust size if needed */
}

.share-link:hover {
    transform: scale(1.1);
}

.share-link.facebook { background-color: #1877F2; }
.share-link.twitter { background-color: #1DA1F2; }
.share-link.linkedin { background-color: #0A66C2; }

.copy-link-container {
    display: flex;
    justify-content: center;
}

.copy-btn-modal {
    width: auto;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.copy-btn-modal .fas {
    margin-right: 8px;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .article-header h1 { font-size: 2.2rem; }
    .article-page-content { padding: 2rem 4%; }
}

@media (max-width: 480px) {
    .article-grid { grid-template-columns: 1fr; }
    .article-header h1 { font-size: 1.8rem; }
    .article-header p { font-size: 1rem; }
    .add-article-btn { width: 50px; height: 50px; font-size: 1.5rem; bottom: 1.5rem; right: 1.5rem; }
}

/* --- Animation Keyframes --- */
@keyframes fadeIn { to { opacity: 1; transform: translateY(0); } }
.article-card-link:nth-child(1) { animation-delay: 0.1s; }
.article-card-link:nth-child(2) { animation-delay: 0.2s; }
.article-card-link:nth-child(3) { animation-delay: 0.3s; }
