/* App Directory Manager Portal - Frontend Shortcode Styles */

.adm-portal-wrapper {
    --adm-fe-bg: #0b0f19;
    --adm-fe-card: rgba(17, 24, 39, 0.65);
    --adm-fe-card-hover: rgba(23, 37, 84, 0.4);
    --adm-fe-border: rgba(255, 255, 255, 0.08);
    --adm-fe-border-hover: rgba(99, 102, 241, 0.4);
    --adm-fe-text: #f3f4f6;
    --adm-fe-text-muted: #9ca3af;
    --adm-fe-accent-indigo: #6366f1;
    --adm-fe-accent-cyan: #06b6d4;
    --adm-fe-accent-gold: #fbbf24;
    --adm-fe-radius: 16px;
    --adm-fe-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --adm-fe-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    background-color: var(--adm-fe-bg);
    color: var(--adm-fe-text);
    padding: 24px;
    border-radius: var(--adm-fe-radius);
    border: 1px solid var(--adm-fe-border);
    box-shadow: var(--adm-fe-shadow);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    margin: 20px 0;
}

/* Password Gate Style */
.adm-gate-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
    background-color: #0b0f19;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.adm-gate-form {
    background: rgba(17, 24, 39, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 32px;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
}

.adm-gate-form h3 {
    margin-top: 0;
    font-size: 22px;
    color: #fff;
    margin-bottom: 8px;
}

.adm-gate-form p {
    color: #9ca3af;
    font-size: 14px;
    margin-bottom: 24px;
}

.adm-input-group {
    display: flex;
    gap: 10px;
}

.adm-input-group input[type="password"] {
    background: rgba(15, 23, 42, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    padding: 10px 14px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    flex-grow: 1;
}

.adm-input-group button {
    background: linear-gradient(135deg, #6366f1, #06b6d4);
    border: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.adm-input-group button:hover {
    transform: translateY(-1px);
}

.adm-error-msg {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
}

.adm-access-denied {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
}

/* Control Bar (Search + Filter Tabs) */
.adm-controls-bar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .adm-controls-bar {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.adm-controls-bar input[type="text"] {
    background: rgba(17, 24, 39, 0.6) !important;
    border: 1px solid var(--adm-fe-border) !important;
    color: var(--adm-fe-text) !important;
    padding: 10px 16px !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    width: 100%;
    max-width: 320px;
    transition: var(--adm-fe-transition);
}

.adm-controls-bar input[type="text"]:focus {
    border-color: var(--adm-fe-accent-cyan) !important;
    box-shadow: 0 0 0 1px var(--adm-fe-accent-cyan) !important;
    outline: none !important;
}

.adm-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.adm-filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    color: var(--adm-fe-text-muted);
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: var(--adm-fe-transition);
}

.adm-filter-btn:hover {
    color: var(--adm-fe-text);
    background: rgba(255, 255, 255, 0.1);
}

.adm-filter-btn.active {
    background: var(--adm-fe-accent-indigo);
    color: white;
}

/* Grid System - Always 3 columns */
.adm-grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px;
}

@media (min-width: 768px) {
    .adm-grid-container {
        gap: 20px;
    }
}

/* Card Styling - SQUARE layout */
.adm-app-card {
    background: var(--adm-fe-card);
    border: 1px solid var(--adm-fe-border);
    border-radius: var(--adm-fe-radius);
    aspect-ratio: 1 / 1; /* Makes card square */
    position: relative;
    overflow: hidden;
    transition: var(--adm-fe-transition);
}

.adm-card-inner {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: 0; /* Cover entire card */
    position: relative;
}

.adm-app-card:hover {
    transform: translateY(-6px);
    background-color: var(--adm-fe-card-hover);
    border-color: var(--adm-fe-accent-indigo);
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.2);
}

/* Favorite Star Badge - Positioned on top of image */
.adm-card-star {
    position: absolute;
    top: 8px;
    left: 8px;
    color: var(--adm-fe-accent-gold);
    font-size: 14px;
    pointer-events: none; /* Non-interactive badge */
    line-height: 1;
    z-index: 3;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

@media (min-width: 768px) {
    .adm-card-star {
        top: 14px;
        left: 14px;
        font-size: 22px;
    }
}

/* Clickable Anchor covers the whole card */
.adm-card-link-anchor {
    text-decoration: none !important;
    display: block;
    width: 100%;
    height: 100%;
    color: inherit;
    position: relative;
}

/* App Icon Container - Covers entire card */
.adm-icon-container {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #101726, #1e1b4b);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.adm-app-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.adm-app-card:hover .adm-app-icon {
    transform: scale(1.08);
}

.adm-app-icon-fallback {
    width: 24px;
    height: 24px;
    color: rgba(255, 255, 255, 0.25);
    transition: var(--adm-fe-transition);
}

@media (min-width: 768px) {
    .adm-app-icon-fallback {
        width: 48px;
        height: 48px;
    }
}

.adm-app-card:hover .adm-app-icon-fallback {
    color: var(--adm-fe-accent-cyan);
    transform: scale(1.1);
}

/* App Name - Overlay at the bottom */
.adm-app-name {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 16px 8px 8px 8px;
    background: linear-gradient(to top, rgba(11, 15, 25, 0.98) 0%, rgba(11, 15, 25, 0.7) 65%, rgba(11, 15, 25, 0) 100%);
    color: var(--adm-fe-text);
    font-weight: 700;
    font-size: 10px;
    line-height: 1.2;
    text-align: center;
    margin: 0;
    z-index: 2;
    transition: var(--adm-fe-transition);
}

@media (min-width: 768px) {
    .adm-app-name {
        padding: 28px 12px 14px 12px;
        font-size: 14px;
        line-height: 1.3;
    }
}

.adm-app-card:hover .adm-app-name {
    color: #fff;
    background: linear-gradient(to top, rgba(17, 24, 39, 1) 0%, rgba(17, 24, 39, 0.85) 75%, rgba(17, 24, 39, 0) 100%);
}

/* Version badge indicators - Positioned on top of image */
.adm-version-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(11, 15, 25, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--adm-fe-text-muted);
    font-size: 8px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 2px;
    cursor: help;
    transition: var(--adm-fe-transition);
    user-select: none;
    -webkit-user-select: none;
    z-index: 3;
}

@media (min-width: 768px) {
    .adm-version-badge {
        bottom: 12px;
        right: 12px;
        font-size: 11px;
        padding: 3px 8px;
        border-radius: 12px;
        gap: 4px;
    }
}

.adm-app-card:hover .adm-version-badge {
    background: var(--adm-fe-accent-indigo);
    color: white;
    border-color: transparent;
}

.adm-version-chevron {
    font-size: 8px;
    transition: transform 0.2s ease;
}

.adm-app-card.show-versions .adm-version-chevron {
    transform: rotate(180deg);
}

/* Version tree dropdown overlay */
.adm-version-tree {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 15, 25, 0.95);
    border-radius: var(--adm-fe-radius);
    box-sizing: border-box;
    padding: 20px;
    display: flex;
    flex-direction: column;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Show when card gets 'show-versions' class */
.adm-app-card.show-versions .adm-version-tree {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.adm-version-tree-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--adm-fe-accent-cyan);
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.adm-version-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.adm-version-list::-webkit-scrollbar {
    width: 4px;
}

.adm-version-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.adm-version-list li {
    margin: 0 !important;
    padding: 0 !important;
}

.adm-version-list a {
    text-decoration: none !important;
    color: var(--adm-fe-text-muted) !important;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    transition: var(--adm-fe-transition);
}

.adm-version-list a:hover {
    color: white !important;
    background: rgba(99, 102, 241, 0.3);
}

.adm-version-list .latest-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--adm-fe-accent-cyan);
}

.adm-no-apps {
    text-align: center;
    padding: 40px;
    color: var(--adm-fe-text-muted);
    border: 1px dashed var(--adm-fe-border);
    border-radius: 12px;
}

/* Album Sub-Tags Styling */
.adm-album-sub-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--adm-fe-border);
    animation: admSlideDown 0.3s ease-out;
}

@keyframes admSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.adm-album-sub-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--adm-fe-border);
    color: var(--adm-fe-text-muted);
    padding: 6px 12px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: var(--adm-fe-transition);
}

.adm-album-sub-btn:hover {
    color: var(--adm-fe-text);
    background: rgba(255, 255, 255, 0.08);
}

.adm-album-sub-btn.active {
    background: var(--adm-fe-accent-cyan);
    color: white;
    border-color: transparent;
}
