:root {
    --ar-primary: #2e8b57;
    /* Eye comfort green */
    --ar-primary-hover: #236b43;
    --ar-text: #333;
    --ar-bg: #fff;
    --ar-border: #f0f0f0;
    --ar-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Main Container */
.asc-container {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    max-width: 100%;
    margin: 30px 0;
    color: var(--ar-text);
}

.asc-card {
    background: var(--ar-bg);
    border-radius: 12px;
    box-shadow: var(--ar-shadow);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--ar-border);
}

.asc-card h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    border-bottom: 1px solid var(--ar-border);
    padding-bottom: 10px;
    color: var(--ar-text);
}

/* Header Card */
.asc-header-card {
    position: relative;
    /* For bookmark positioning */
}

.asc-header-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.asc-app-icon {
    width: 95px;
    height: 95px;
    flex-shrink: 0;
}

.asc-app-icon img {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.asc-app-meta {
    flex: 1;
}

.asc-title {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--ar-text);
}

.asc-sub-meta {
    font-size: 14px;
    color: #666;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.asc-sep {
    color: #ddd;
}

.asc-header-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    color: #333;
}

.asc-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: stretch;
}

.asc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 18px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    gap: 8px;
    line-height: 1;
    /* Premium Button Styles */
    background: linear-gradient(135deg, var(--ar-primary) 0%, var(--ar-primary-hover) 100%);
    color: #fff;
    box-shadow: 0 4px 10px rgba(26, 147, 101, 0.2);
    position: relative;
    overflow: hidden;
}

.asc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(26, 147, 101, 0.3);
    color: #fff;
}

.asc-btn:active {
    transform: translateY(0);
}

.asc-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.asc-btn-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.asc-btn-text {
    font-weight: 700;
    letter-spacing: 0.3px;
}

.asc-btn-download {
    background: linear-gradient(135deg, #2e8b57 0%, #236b43 100%);
    flex: 2;
}

.asc-btn-telegram {
    background: linear-gradient(135deg, #0088cc 0%, #0077b5 100%);
    box-shadow: 0 4px 10px rgba(0, 136, 204, 0.2);
    flex: 1.5;
}

.asc-btn-telegram:hover {
    box-shadow: 0 6px 15px rgba(0, 136, 204, 0.3);
}

.asc-btn-share {
    background: #fff;
    color: #333;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    flex: 1;
}

.asc-btn-share:hover {
    background: #f8f9fa;
    color: #333;
    border-color: #d0d0d0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.asc-btn-share .asc-btn-icon {
    color: #555;
}

/* FAQ List */
.asc-faq-list {
    list-style: none;
    padding: 20px;
    margin: 0;
}

.asc-faq-item {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.asc-faq-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.asc-faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    padding: 10px 0;
}

.asc-faq-answer {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.asc-faq-item.open .asc-faq-answer {
    max-height: 500px;
    /* Approximate max height */
    margin-top: 10px;
}

.asc-faq-icon {
    color: var(--ar-primary);
    transition: transform 0.3s ease;
}

.asc-faq-item.open .asc-faq-icon {
    transform: rotate(180deg);
}

/* Bookmark Button */
.asc-bookmark-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #e8f5e9;
    border: none;
    cursor: pointer;
    color: #2e8b57;
    /* Primary color */
    transition: all 0.3s ease;
    padding: 8px;
    z-index: 10;
    border-radius: 50%;
    /* Make it round */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.asc-bookmark-btn:hover {
    transform: scale(1.1);
    background: #d0e8d4;
}

.asc-bookmark-btn.active {
    color: #2e8b57;
    background: #e8f5e9;
}

.asc-bookmark-btn svg {
    width: 24px;
    height: 24px;
}

/* Old Versions Collapsible */
.asc-versions-card,
.asc-faq-card {
    padding: 0;
    overflow: hidden;
    border-radius: 12px;
    /* Ensure consistency */
}

.asc-collapse-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: #fff;
    transition: background 0.2s;
    /* Ensure arrow is on the right */
    flex-direction: row;
    user-select: none;
}

.asc-collapse-header:hover {
    background: #f9f9f9;
}

.asc-header-title {
    display: flex;
    align-items: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--ar-text);
}

.asc-toggle-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #888;
    position: relative;
    /* For absolute positioning of icons */
}

.asc-toggle-icons svg {
    position: absolute;
    top: 0;
    left: 0;
    transition: all 0.3s ease;
}

/* Toggle Logic: Smooth Transition */
.asc-collapse-header[aria-expanded="true"] .asc-icon-plus svg {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.asc-collapse-header[aria-expanded="true"] .asc-icon-minus svg {
    opacity: 1;
    transform: rotate(0) scale(1);
}

.asc-collapse-header[aria-expanded="false"] .asc-icon-plus svg {
    opacity: 1;
    transform: rotate(0) scale(1);
}

.asc-collapse-header[aria-expanded="false"] .asc-icon-minus svg {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

.asc-collapse-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: #fcfcfc;
    border-top: 1px solid var(--ar-border);
}

.asc-collapse-content.open {
    /* max-height will be set by JS for smooth animation, but start visible */
    max-height: none;
}

.asc-versions-list {
    list-style: none;
    padding: 20px;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.asc-versions-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border: 1px solid #eee;
    border-radius: 10px;
    background: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
}

.asc-versions-list li:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    border-color: #e0e0e0;
}

.asc-v-info {
    display: flex;
    flex-direction: column;
}

.asc-v-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.asc-v-size {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.asc-v-download {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #e6f2ff;
    color: var(--ar-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s;
}

.asc-v-download:hover {
    background: var(--ar-primary);
    color: #fff;
}

/* App Info */
.asc-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
}

.asc-info-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: background 0.2s;
}

.asc-info-item:hover {
    background: #fff;
    border-color: #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.asc-info-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #e8f5e9;
    color: var(--ar-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.asc-info-content {
    display: flex;
    flex-direction: column;
}

.asc-info-item strong {
    display: block;
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.asc-info-item span {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

/* Scroll Containers */
.asc-scroll-container {
    overflow-x: auto;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.asc-scroll-container::-webkit-scrollbar {
    display: none;
}

.asc-scroll-wrapper {
    display: flex;
    gap: 15px;
}

/* Similar Apps */
.asc-similar-item {
    flex: 0 0 100px;
    text-decoration: none;
    text-align: center;
}

.asc-s-icon {
    width: 100px;
    height: 100px;
    margin-bottom: 8px;
}

.asc-s-icon img,
.asc-no-icon {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    background: #eee;
    transition: transform 0.2s;
}

.asc-similar-item:hover .asc-s-icon img {
    transform: translateY(-5px);
}

.asc-s-title {
    font-size: 13px;
    color: #333;
    font-weight: 500;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Screenshots */
.asc-screenshot-item {
    flex: 0 0 180px;
    height: 320px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
    /* Ensure click area */
    z-index: 1;
}

.asc-screenshot-item:hover {
    transform: scale(1.02);
}

.asc-screenshot-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Breadcrumbs */
.asc-breadcrumbs {
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.asc-breadcrumbs a {
    color: var(--ar-primary);
    text-decoration: none;
}

.asc-breadcrumbs .asc-sep {
    color: #ccc;
    margin: 0 5px;
}

/* Reviews */
.asc-review-form {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.asc-review-form h4 {
    margin-top: 0;
    margin-bottom: 15px;
}

.asc-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 12px;
    /* Match buttons and cards */
    margin-bottom: 10px;
    font-family: inherit;
    box-sizing: border-box;
}

.asc-rating-input {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.asc-stars {
    display: flex;
    flex-direction: row-reverse;
    gap: 5px;
}

.asc-stars input {
    display: none;
}

.asc-stars label {
    font-size: 24px;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s;
}

.asc-stars input:checked~label,
.asc-stars label:hover,
.asc-stars label:hover~label {
    color: #ffc107;
}

.asc-review-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.asc-review-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    flex-shrink: 0;
}

.asc-review-content {
    flex: 1;
}

.asc-review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.asc-review-author {
    font-weight: 600;
    color: #333;
}

.asc-review-date {
    font-size: 12px;
    color: #999;
}

.asc-review-stars {
    color: #ffc107;
    margin-bottom: 8px;
    font-size: 14px;
}

.asc-review-text {
    font-size: 14px;
    line-height: 1.5;
    color: #555;
}

/* Lightbox */
.asc-lightbox {
    display: none;
    position: fixed;
    z-index: 99999;
    padding-top: 0;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    /* Pure black background */
    align-items: center;
    justify-content: center;
}

.asc-lightbox.active {
    display: flex;
}

.asc-lightbox-content {
    margin: auto;
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    /* Ensure image fits within viewport */
    animation-name: zoom;
    animation-duration: 0.3s;
    border-radius: 0;
    /* No border radius for fullscreen feel */
    box-shadow: none;
}

@keyframes zoom {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.asc-lightbox-close {
    position: absolute;
    top: 20px;
    left: 20px;
    /* Close button on left for Play Store feel? Or keep right? Standard is often right or top-left back arrow. Let's keep right for now but style it better. */
    color: #fff;
    font-size: 30px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.asc-lightbox-nav {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    /* Subtle background */
    border-radius: 50%;
    margin: 0 20px;
}

.asc-lightbox-nav:hover {
    background-color: rgba(0, 0, 0, 0.6);
}

.asc-next {
    right: 0;
}

.asc-prev {
    left: 0;
}

.asc-hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 600px) {
    .asc-header-row {
        flex-direction: column;
        text-align: center;
    }

    .asc-sub-meta {
        justify-content: center;
    }

    .asc-actions {
        flex-direction: column;
    }

    .asc-btn {
        width: 100%;
    }

    .asc-versions-list {
        grid-template-columns: 1fr;
    }
}

/* Desktop full-width buttons equally spaced */
.asc-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 16px !important;
    width: 100% !important;
}

/* Make all buttons auto-fit full height */
.asc-btn {
    width: 100% !important;
}

/* Lightbox center image */
.asc-lightbox-content {
    display: block;
    margin: 0 auto !important;
    max-height: 90vh;
}

/* Desktop button ratios */

.asc-btn-download {
    flex: 0 0 50% !important;
}

.asc-btn-telegram {
    flex: 0 0 30% !important;
}

.asc-btn-share {
    flex: 0 0 20% !important;
}

/* Mobile full width */
@media(max-width:768px) {
    .asc-btn {
        width: 100% !important;
    }

    .asc-actions .asc-btn {
        width: 100% !important;
    }
}

/* Center fullscreen screenshot */
.asc-lightbox-content {
    display: block;
    margin: 0 auto !important;
    max-height: 90vh;
}

/* Fix buttons not staying in same row */
.asc-actions .asc-btn {
    display: inline-flex;
    white-space: nowrap;
}


/* Fix card and button overflow - Allow overflow for hover effects */
.asc-card,
.asc-container {
    overflow: visible;
    /* Changed from hidden to visible */
    box-sizing: border-box !important;
}

.asc-actions {
    overflow: visible;
    /* Ensure buttons can scale */
    box-sizing: border-box !important;
}

/* Updated App Icon size */
.asc-header-icon img {
    width: 120px !important;
    height: 120px !important;
    border-radius: 18px !important;
}

/* Desktop layout */
@media (min-width: 769px) {
    .asc-actions {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 14px !important;
        width: 100%;
        padding: 0 4px;
        box-sizing: border-box;
    }

    .asc-actions .asc-btn-download {
        flex: 0 0 calc(50% - 10px) !important;
    }

    .asc-actions .asc-btn-telegram {
        flex: 0 0 calc(30% - 10px) !important;
    }

    .asc-actions .asc-btn-share {
        flex: 0 0 calc(20% - 10px) !important;
    }
}

/* Mobile layout */
@media (max-width: 768px) {
    .asc-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        width: 100% !important;
    }

    .asc-actions .asc-btn {
        width: 100% !important;
    }

    .asc-header-icon img {
        width: 110px !important;
        height: 110px !important;
    }
}

/* Button width control */
.asc-btn {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Center fullscreen screenshot */
.asc-lightbox-content {
    display: block;
    margin: 0 auto !important;
    max-height: 90vh !important;
}


/* Removed rotation logic as we use icon swapping now */

/* Mobile Adjustments */
@media (max-width: 600px) {
    .asc-versions-list {
        grid-template-columns: 1fr;
    }

    .asc-actions {
        flex-direction: column;
    }

    .asc-btn {
        width: 100%;
        margin-bottom: 10px;
    }
}