/* =========================================================
   PHARMA TIPS ZONE
   REUSABLE COMPONENT STYLES

   These components can be used across the entire website.
========================================================= */


/* =========================================================
   1. BUTTON COMPONENTS
========================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 42px;
    padding: 10px 20px;

    border: 1px solid transparent;
    border-radius: 5px;

    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;

    text-align: center;
    cursor: pointer;

    transition:
        background-color .2s ease,
        color .2s ease,
        border-color .2s ease,
        transform .2s ease,
        box-shadow .2s ease;
}

.btn:hover {
    text-decoration: none;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--white);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-dark {
    background: var(--dark);
    color: var(--white);
    border-color: var(--dark);
}

.btn-dark:hover {
    background: #000;
    color: var(--white);
}

.btn-light {
    background: var(--white);
    color: var(--text);
    border-color: var(--border);
}

.btn-light:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-sm {
    min-height: 34px;
    padding: 8px 14px;
    font-size: 10px;
}

.btn-lg {
    min-height: 48px;
    padding: 13px 28px;
    font-size: 13px;
}


/* =========================================================
   2. CARD COMPONENT
========================================================= */

.card {
    background: var(--white);

    border: 1px solid var(--border);
    border-radius: 6px;

    overflow: hidden;

    transition:
        box-shadow .25s ease,
        transform .25s ease,
        border-color .25s ease;
}

.card-hover:hover {
    border-color: #ddd;

    box-shadow:
        0 8px 25px rgba(0, 0, 0, .08);

    transform: translateY(-2px);
}

.card-body {
    padding: 20px;
}

.card-header {
    padding: 15px 20px;

    border-bottom: 1px solid var(--border);

    background: var(--white);
}

.card-footer {
    padding: 15px 20px;

    border-top: 1px solid var(--border);

    background: var(--white);
}


/* =========================================================
   3. IMAGE CARD
========================================================= */

.image-card {
    position: relative;

    overflow: hidden;

    background: var(--white);
}

.image-card img {
    width: 100%;

    object-fit: cover;

    transition: transform .35s ease;
}

.image-card:hover img {
    transform: scale(1.03);
}


/* =========================================================
   4. CATEGORY BADGE
========================================================= */

.category-badge {
    display: inline-block;

    padding: 5px 9px;

    border-radius: 3px;

    background: var(--primary);
    color: var(--white);

    font-size: 9px;
    font-weight: 700;

    line-height: 1;

    text-transform: uppercase;
}


/* =========================================================
   5. ARTICLE META
========================================================= */

.article-meta {
    display: flex;

    align-items: center;

    flex-wrap: wrap;

    gap: 12px;

    color: var(--muted);

    font-size: 11px;
}

.article-meta span {
    display: inline-flex;

    align-items: center;

    gap: 5px;
}

.article-meta i {
    color: var(--primary);
}


/* =========================================================
   6. AUTHOR
========================================================= */

.author {
    display: flex;

    align-items: center;

    gap: 10px;
}

.author-avatar {
    width: 38px;
    height: 38px;

    flex: 0 0 38px;

    border-radius: 50%;

    overflow: hidden;

    background: var(--primary-light);
}

.author-avatar img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}

.author-info {
    min-width: 0;
}

.author-name {
    margin: 0;

    color: var(--text);

    font-size: 12px;
    font-weight: 700;
}

.author-role {
    margin: 2px 0 0;

    color: var(--muted);

    font-size: 10px;
}


/* =========================================================
   7. VIDEO CARD
========================================================= */

.video-card {
    position: relative;

    overflow: hidden;

    background: var(--white);

    border: 1px solid var(--border);
    border-radius: 6px;
}

.video-thumbnail {
    position: relative;

    overflow: hidden;

    aspect-ratio: 16 / 9;

    background: #eee;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    transition: transform .35s ease;
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.04);
}

.video-overlay {
    position: absolute;

    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(0, 0, 0, .08);
}

.play-button {
    width: 52px;
    height: 52px;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(0, 0, 0, .72);

    color: var(--white);

    font-size: 17px;

    transition:
        background-color .2s ease,
        transform .2s ease;
}

.video-card:hover .play-button {
    background: var(--primary);

    transform: scale(1.08);
}

.video-duration {
    position: absolute;

    right: 8px;
    bottom: 8px;

    padding: 4px 6px;

    border-radius: 3px;

    background: rgba(0, 0, 0, .75);

    color: var(--white);

    font-size: 9px;
    font-weight: 700;
}

.video-content {
    padding: 14px;
}

.video-title {
    margin: 0 0 7px;

    color: var(--text);

    font-size: 14px;
    font-weight: 700;

    line-height: 1.35;
}

.video-description {
    margin: 0;

    color: var(--muted);

    font-size: 11px;

    line-height: 1.6;
}


/* =========================================================
   8. CALCULATOR CARD
========================================================= */

.calculator-card {
    height: 100%;

    padding: 20px;

    background: var(--white);

    border: 1px solid var(--border);

    border-radius: 7px;

    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        transform .2s ease;
}

.calculator-card:hover {
    border-color: var(--primary);

    box-shadow:
        0 8px 24px rgba(0, 0, 0, .07);

    transform: translateY(-2px);
}

.calculator-icon {
    width: 50px;
    height: 50px;

    margin-bottom: 15px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 6px;

    background: var(--primary-light);

    color: var(--primary);

    font-size: 21px;
}

.calculator-title {
    margin: 0 0 8px;

    color: var(--text);

    font-size: 15px;
    font-weight: 700;
}

.calculator-description {
    min-height: 42px;

    margin: 0 0 16px;

    color: var(--muted);

    font-size: 11px;

    line-height: 1.55;
}


/* =========================================================
   9. ALERT
========================================================= */

.alert {
    display: flex;

    align-items: flex-start;

    gap: 10px;

    padding: 13px 15px;

    border: 1px solid transparent;
    border-radius: 5px;

    font-size: 12px;
}

.alert i {
    margin-top: 2px;
}

.alert-primary {
    background: var(--primary-light);

    color: var(--primary);

    border-color: rgba(var(--primary-rgb), .18);
}

.alert-success {
    background: #eef9f1;

    color: #218838;

    border-color: #c9e8d0;
}

.alert-danger {
    background: #fff1f1;

    color: #d71920;

    border-color: #f2c6c6;
}

.alert-warning {
    background: #fff8e6;

    color: #9a6b00;

    border-color: #f2dfad;
}


/* =========================================================
   10. FORM GROUP
========================================================= */

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;

    margin-bottom: 7px;

    color: var(--text);

    font-size: 12px;
    font-weight: 700;
}

.form-required {
    color: var(--primary);
}

.form-help {
    display: block;

    margin-top: 5px;

    color: var(--muted);

    font-size: 10px;
}


/* =========================================================
   11. CHECKBOX / RADIO
========================================================= */

.form-check {
    display: flex;

    align-items: center;

    gap: 8px;

    margin-bottom: 8px;
}

.form-check input {
    width: 15px;
    height: 15px;

    accent-color: var(--primary);
}

.form-check label {
    margin: 0;

    color: var(--text);

    font-size: 12px;

    cursor: pointer;
}


/* =========================================================
   12. SEARCH BOX COMPONENT
========================================================= */

.search-box {
    width: 100%;

    display: flex;
    align-items: center;

    border: 1px solid var(--border);

    border-radius: 5px;

    overflow: hidden;

    background: var(--white);
}

.search-box input {
    flex: 1;

    width: 100%;

    min-width: 0;

    border: 0;
    outline: 0;

    padding: 12px 14px;

    color: var(--text);

    font-size: 12px;
}

.search-box button {
    width: 45px;

    align-self: stretch;

    border: 0;

    background: var(--primary);

    color: var(--white);

    display: flex;
    align-items: center;
    justify-content: center;
}

.search-box button:hover {
    background: var(--primary-dark);
}


/* =========================================================
   13. PAGINATION
========================================================= */

.pagination {
    display: flex;

    align-items: center;

    justify-content: center;

    flex-wrap: wrap;

    gap: 6px;

    margin: 30px 0 0;

    padding: 0;

    list-style: none;
}

.pagination a,
.pagination span {
    min-width: 34px;
    height: 34px;

    padding: 0 10px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--border);

    border-radius: 4px;

    background: var(--white);

    color: var(--text);

    font-size: 11px;

    transition:
        background-color .2s ease,
        color .2s ease,
        border-color .2s ease;
}

.pagination a:hover,
.pagination .active {
    background: var(--primary);

    border-color: var(--primary);

    color: var(--white);
}


/* =========================================================
   14. MODAL
========================================================= */

.modal-overlay {
    position: fixed;

    inset: 0;

    z-index: 9999;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(0, 0, 0, .65);
}

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

.modal {
    width: 100%;
    max-width: 600px;

    max-height: calc(100vh - 40px);

    overflow-y: auto;

    background: var(--white);

    border-radius: 7px;

    box-shadow:
        0 20px 50px rgba(0, 0, 0, .25);
}

.modal-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    padding: 17px 20px;

    border-bottom: 1px solid var(--border);
}

.modal-title {
    margin: 0;

    color: var(--text);

    font-size: 17px;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;

    border: 0;

    background: transparent;

    color: var(--muted);

    font-size: 18px;
}

.modal-close:hover {
    color: var(--primary);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;

    justify-content: flex-end;

    gap: 10px;

    padding: 15px 20px;

    border-top: 1px solid var(--border);
}


/* =========================================================
   15. DROPDOWN
========================================================= */

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;

    top: calc(100% + 5px);
    left: 0;

    z-index: 2000;

    min-width: 190px;

    padding: 7px 0;

    display: none;

    background: var(--white);

    border: 1px solid var(--border);

    border-radius: 5px;

    box-shadow:
        0 8px 25px rgba(0, 0, 0, .12);
}

.dropdown:hover .dropdown-menu,
.dropdown.open .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;

    padding: 10px 14px;

    color: var(--text);

    font-size: 11px;
}

.dropdown-menu a:hover {
    background: var(--primary-light);

    color: var(--primary);
}


/* =========================================================
   16. EMPTY STATE
========================================================= */

.empty-state {
    padding: 50px 20px;

    text-align: center;

    border: 1px dashed var(--border);

    border-radius: 6px;

    background: var(--light);
}

.empty-state-icon {
    margin-bottom: 12px;

    color: #aaa;

    font-size: 35px;
}

.empty-state h3 {
    margin: 0 0 7px;

    font-size: 17px;
}

.empty-state p {
    margin: 0;

    color: var(--muted);

    font-size: 12px;
}


/* =========================================================
   17. LOADING
========================================================= */

.loading-spinner {
    width: 32px;
    height: 32px;

    border: 3px solid var(--border);

    border-top-color: var(--primary);

    border-radius: 50%;

    animation: component-spin .7s linear infinite;
}

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

.loading-wrapper {
    min-height: 120px;

    display: flex;
    align-items: center;
    justify-content: center;
}


/* =========================================================
   18. TOAST
========================================================= */

.toast {
    position: fixed;

    right: 20px;
    bottom: 20px;

    z-index: 10000;

    min-width: 280px;
    max-width: 400px;

    padding: 14px 16px;

    border-radius: 5px;

    background: var(--dark);

    color: var(--white);

    font-size: 12px;

    box-shadow:
        0 8px 25px rgba(0, 0, 0, .2);
}

.toast-primary {
    border-left: 4px solid var(--primary);
}


/* =========================================================
   19. STAT BOX
========================================================= */

.stat-box {
    padding: 18px;

    background: var(--white);

    border: 1px solid var(--border);

    border-radius: 6px;
}

.stat-value {
    margin: 0 0 4px;

    color: var(--primary);

    font-size: 25px;
    font-weight: 800;
}

.stat-label {
    margin: 0;

    color: var(--muted);

    font-size: 11px;
}


/* =========================================================
   20. TABLE WRAPPER
========================================================= */

.table-responsive {
    width: 100%;

    overflow-x: auto;

    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;

    border-collapse: collapse;

    background: var(--white);

    font-size: 12px;
}

.data-table th,
.data-table td {
    padding: 12px 14px;

    border-bottom: 1px solid var(--border);

    text-align: left;

    vertical-align: middle;
}

.data-table th {
    background: var(--light);

    color: var(--text);

    font-size: 11px;
    font-weight: 700;
}

.data-table td {
    color: var(--muted);
}

.data-table tbody tr:hover {
    background: var(--primary-light);
}


/* =========================================================
   21. AVATAR SIZES
========================================================= */

.avatar {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    overflow: hidden;

    border-radius: 50%;

    background: var(--primary-light);

    color: var(--primary);

    font-weight: 700;
}

.avatar-sm {
    width: 32px;
    height: 32px;

    font-size: 11px;
}

.avatar-md {
    width: 44px;
    height: 44px;

    font-size: 13px;
}

.avatar-lg {
    width: 64px;
    height: 64px;

    font-size: 18px;
}

.avatar img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}


/* =========================================================
   22. TAGS
========================================================= */

.tag-list {
    display: flex;

    flex-wrap: wrap;

    gap: 6px;
}

.tag {
    display: inline-block;

    padding: 5px 9px;

    border: 1px solid var(--border);

    border-radius: 3px;

    background: var(--white);

    color: var(--muted);

    font-size: 10px;
}

.tag:hover {
    border-color: var(--primary);

    color: var(--primary);
}


/* =========================================================
   23. RESPONSIVE COMPONENT ADJUSTMENTS
========================================================= */

@media (max-width: 767px) {

    .btn-lg {
        min-height: 44px;

        padding: 11px 20px;

        font-size: 12px;
    }

    .card-body {
        padding: 16px;
    }

    .calculator-card {
        padding: 16px;
    }

    .video-title {
        font-size: 13px;
    }

    .modal-overlay {
        padding: 12px;
    }

    .modal {
        max-height: calc(100vh - 24px);
    }

    .toast {
        left: 12px;
        right: 12px;

        min-width: 0;
        max-width: none;
    }

    .data-table {
        min-width: 650px;
    }

}

/* =========================================================
   SUBMIT CTA COMPONENT
   Reusable across:
   Home
   Articles
   Videos
   Forum
   Other content pages
========================================================= */

.submit-cta {
    padding: 35px 0;

    color: var(--white);

    background:
        linear-gradient(
            rgba(var(--primary-rgb), .92),
            rgba(var(--primary-rgb), .92)
        ),
        url("https://images.unsplash.com/photo-1576091160399-112ba8d25d1d?auto=format&fit=crop&w=1600&q=80")
        center / cover;
}

.cta-inner {
    display: flex;

    align-items: center;

    gap: 25px;
}

.cta-icon {
    width: 75px;
    height: 75px;

    flex: 0 0 75px;

    background: var(--white);

    color: var(--primary);

    border-radius: 50%;

    display: flex;

    align-items: center;
    justify-content: center;

    font-size: 32px;
}

.cta-content {
    flex: 1;
}

.cta-content h2 {
    margin: 0 0 8px;

    color: var(--white);

    font-size: 27px;

    line-height: 1.1;
}

.cta-content p {
    margin: 0;

    color: var(--white);

    font-size: 13px;
}

.cta-button {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    padding: 13px 25px;

    border: 2px solid var(--white);

    border-radius: 4px;

    background: transparent;

    color: var(--white);

    font-size: 12px;
    font-weight: 700;

    white-space: nowrap;

    transition:
        background-color .2s ease,
        color .2s ease;
}

.cta-button:hover {
    background: var(--white);

    color: var(--primary);
}