/* Home redesign (Oct 2026): app bar, Home segments and the course card, matching the
   Android app. Needs acagram-theme.css (tokens) and vazirmatn.css. */

/* App bar: brand green in light and dark mode, rounded bottom corners. */
.ac-app-bar {
    background: var(--ac-brand) !important;
    border: none !important;
    border-radius: 0 0 18px 18px;
    box-shadow: none !important;
}

.ac-app-bar .ac-app-bar-title,
.ac-app-bar .ac-app-bar-title:hover,
.ac-app-bar .ac-app-bar-title:focus {
    margin-inline-start: 8px;
    color: var(--ac-on-brand) !important;
    font-size: 18px;
    font-weight: 700;
    opacity: 1;
    text-decoration: none;
}

/* Segment header: title plus a "see all" link, hidden until a see-all list exists
   (needs backend support). */
.ac-segment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 12px 0 6px;
    padding: 0 8px;
}

.ac-segment-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--ac-text);
}

.ac-see-all {
    color: var(--ac-link);
    font-size: 13px;
    font-weight: 700;
}

/* Banners */
.ac-banner,
.ac-banner img {
    border-radius: 18px !important;
    overflow: hidden;
}

.ac-banner {
    display: block;
    background: var(--ac-thumbnail-placeholder);
}

.owl-theme .owl-dots .owl-dot span {
    background: var(--ac-slider-dot-inactive);
}

.owl-theme .owl-dots .owl-dot.active span,
.owl-theme .owl-dots .owl-dot:hover span {
    background: var(--ac-slider-dot-active);
}

/* Horizontal course list: a swipeable strip of fixed-width cards, like the app. */
.ac-course-strip {
    display: flex;
    gap: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 0 10px;
}

.ac-course-strip::-webkit-scrollbar {
    display: none;
}

.ac-course-strip > .ac-course-card {
    flex: 0 0 160px;
    width: 160px;
    scroll-snap-align: start;
}

/* Vertical course list: two columns on phones, more on wider screens. */
.ac-course-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .ac-course-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .ac-course-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Course card */
.ac-course-card {
    display: flex;
    flex-direction: column;
    margin: 6px;
    background: var(--ac-card-surface);
    border: 1px solid var(--ac-card-stroke);
    border-radius: 18px;
    box-shadow: var(--ac-card-shadow);
    overflow: hidden;
    cursor: pointer;
    color: var(--ac-text);
}

/* The thumbnail keeps its own aspect ratio, as in the app. */
.ac-course-thumb {
    display: block;
    min-height: 60px;
    background: var(--ac-thumbnail-placeholder);
}

.ac-course-thumb img {
    display: block;
    width: 100%;
    height: auto;
}

.ac-course-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 10px 12px;
    min-width: 0;
}

.ac-course-title,
.ac-course-title:hover,
.ac-course-title:focus {
    display: block;
    overflow: hidden;
    color: var(--ac-text);
    font-size: 14px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
}

.ac-course-teacher,
.ac-course-teacher:hover,
.ac-course-teacher:focus {
    display: block;
    margin-top: 4px;
    overflow: hidden;
    color: var(--ac-text-secondary);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
}

/* Footer for courses the user already has (or teaches): lessons, duration, etc. */
.ac-course-meta {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--ac-divider);
    color: var(--ac-text-secondary);
    font-size: 12px;
}

/* Same height on every card (free, discounted or plain), bottom-anchored, so cards in a
   row line up whichever variant they are. Prices sit at the end (left, in RTL). */
.ac-price-block {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    height: 62px;
    margin-top: 6px;
}

.ac-price-tags {
    display: flex;
    align-items: center;
    align-self: center;
    max-width: 100%;
    margin-bottom: 4px;
    white-space: nowrap;
}

.ac-discount-tag {
    flex: none;
    margin-inline-end: 6px;
    padding: 3px 10px;
    border-radius: 6px;
    background: var(--ac-discount-tag);
    color: var(--ac-on-discount-tag);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

/* Shrunk by acFitText() in acagram-home.js instead of wrapping on narrow cards. */
.ac-original-price {
    min-width: 0;
    color: var(--ac-course-original-price);
    font-size: 12px;
    text-decoration: line-through;
    white-space: nowrap;
}

.ac-price-row {
    display: flex;
    align-items: baseline;
    white-space: nowrap;
}

/* Black on its own: browsers already render it as heavy as the Android app's stroked
   price, so no outline here (one made it visibly bolder than the app). */
.ac-price {
    color: var(--ac-course-price);
    font-size: 18px;
    font-weight: 900;
    line-height: 1.3;
}

.ac-currency {
    margin-inline-start: 3px;
    color: var(--ac-course-price);
    font-size: 9px;
}

.ac-free-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 4px;
    padding: 5px 16px;
    border-radius: 100px;
    background: var(--ac-free-tag);
    box-shadow: 0 2px 8px rgba(219, 39, 119, 0.45);
    color: var(--ac-on-free-tag);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
}

.ac-free-tag svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
}
