/**
 * Pretpot App Downloads Buttons Widget Styles
 */

/* Container */
.pretpot-app-downloads {
    display: flex;
    gap: var(--button-gap, 16px);
    align-items: center;
}

.pretpot-app-downloads--vertical {
    flex-direction: column;
    align-items: flex-start;
}

.pretpot-app-downloads--inline {
    flex-direction: row;
    flex-wrap: wrap;
}

/* Skeleton Loading State */
.pretpot-app-downloads__skeleton {
    display: flex;
    gap: var(--button-gap, 16px);
    align-items: center;
}

.pretpot-app-downloads__skeleton-item {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: pretpot-skeleton-shimmer 1.5s infinite;
    border-radius: 8px;
    height: 48px;
}

.pretpot-app-downloads__skeleton-item--app-store {
    width: 140px;
}

.pretpot-app-downloads__skeleton-item--google-play {
    width: 155px;
}

@keyframes pretpot-skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* App Store Buttons */
.pretpot-app-downloads__button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #000000;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
    min-height: 48px;
}

.pretpot-app-downloads__button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pretpot-app-downloads__button:focus {
    outline: 2px solid #007aff;
    outline-offset: 2px;
}

/* App Store Specific */
.pretpot-app-downloads__button--app-store:hover .pretpot-app-downloads__apple-logo {
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
    animation: pretpot-apple-glow 1.5s ease-in-out infinite alternate;
}

@keyframes pretpot-apple-glow {
    from { filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.4)); }
    to { filter: drop-shadow(0 0 12px rgba(255, 255, 255, 1)); }
}

/* Google Play Specific */
.pretpot-app-downloads__button--google-play:hover .pretpot-app-downloads__play-triangle {
    animation: pretpot-play-spin 0.6s ease-in-out;
}

@keyframes pretpot-play-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Button Content Layout */
.pretpot-app-downloads__content {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.pretpot-app-downloads__pretext {
    font-size: 10px;
    font-weight: 400;
    opacity: 0.9;
    text-transform: none;
    letter-spacing: 0;
}

.pretpot-app-downloads__store-name {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

/* App Info Display */
.pretpot-app-downloads__info {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    font-size: 11px;
    opacity: 0.85;
}

.pretpot-app-downloads__rating {
    display: flex;
    align-items: center;
    gap: 2px;
}

.pretpot-app-downloads__star {
    color: #ffd700;
    font-size: 10px;
}

.pretpot-app-downloads__price {
    font-weight: 500;
}

/* Icons */
.pretpot-app-downloads__icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.pretpot-app-downloads__apple-logo {
    fill: currentColor;
    transition: filter 0.3s ease;
}

.pretpot-app-downloads__play-icon {
    width: 28px;
    height: 28px;
}

.pretpot-app-downloads__play-triangle {
    fill: #00d2ff;
    transform-origin: center;
    transition: transform 0.3s ease;
}

/* Hidden State for Platform Detection */
.pretpot-app-downloads__button--hidden {
    display: none !important;
}

/* Modal Styles */
.pretpot-app-downloads__modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.pretpot-app-downloads__modal-overlay--active {
    opacity: 1;
    visibility: visible;
}

.pretpot-app-downloads__modal {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.pretpot-app-downloads__modal-overlay--active .pretpot-app-downloads__modal {
    transform: scale(1);
}

.pretpot-app-downloads__modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: #f5f5f5;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.pretpot-app-downloads__modal-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px;
    color: #1a1a1a;
}

.pretpot-app-downloads__modal-text {
    font-size: 15px;
    color: #666;
    margin: 0 0 24px;
    line-height: 1.5;
}

.pretpot-app-downloads__modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.pretpot-app-downloads__modal-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.pretpot-app-downloads__modal-btn--primary {
    background: #007aff;
    color: #ffffff;
}

.pretpot-app-downloads__modal-btn--primary:hover {
    background: #0056b3;
}

.pretpot-app-downloads__modal-btn--secondary {
    background: #f5f5f5;
    color: #333;
}

.pretpot-app-downloads__modal-btn--secondary:hover {
    background: #e5e5e5;
}

/* Focus trap indicator */
.pretpot-app-downloads__modal:focus-visible {
    outline: 2px solid #007aff;
    outline-offset: 4px;
}

/* Alignment Variants */
.pretpot-app-downloads--align-left {
    justify-content: flex-start;
}

.pretpot-app-downloads--align-center {
    justify-content: center;
}

.pretpot-app-downloads--align-right {
    justify-content: flex-end;
}

.pretpot-app-downloads--vertical.pretpot-app-downloads--align-center {
    align-items: center;
}

.pretpot-app-downloads--vertical.pretpot-app-downloads--align-right {
    align-items: flex-end;
}

/* Size Variants */
.pretpot-app-downloads--size-small .pretpot-app-downloads__button {
    padding: 6px 12px;
    min-height: 40px;
}

.pretpot-app-downloads--size-small .pretpot-app-downloads__icon {
    width: 24px;
    height: 24px;
}

.pretpot-app-downloads--size-small .pretpot-app-downloads__store-name {
    font-size: 14px;
}

.pretpot-app-downloads--size-large .pretpot-app-downloads__button {
    padding: 12px 20px;
    min-height: 56px;
}

.pretpot-app-downloads--size-large .pretpot-app-downloads__icon {
    width: 32px;
    height: 32px;
}

.pretpot-app-downloads--size-large .pretpot-app-downloads__store-name {
    font-size: 18px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .pretpot-app-downloads__button {
        background: #1a1a1a;
    }
    
    .pretpot-app-downloads__modal {
        background: #2a2a2a;
        color: #fff;
    }
    
    .pretpot-app-downloads__modal-title {
        color: #fff;
    }
    
    .pretpot-app-downloads__modal-text {
        color: #aaa;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .pretpot-app-downloads__skeleton-item,
    .pretpot-app-downloads__button,
    .pretpot-app-downloads__modal-overlay,
    .pretpot-app-downloads__modal {
        animation: none;
        transition: none;
    }
}