/**
 * App API Bridge — Styles
 *
 * Minimal, responsive, and easily overridable.
 *
 * @package App_API_Bridge
 * @since   1.0.0
 */

/* Cache-safe auth visibility */
.app-auth-hide { display: none !important; }

/* =========================================================
   Auth Forms
   ========================================================= */

.app-auth-form {
    max-width: 400px;
    margin: 0 auto;
}

.app-form-group {
    margin-bottom: 14px;
}

.app-form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 13px;
}

.app-form-group input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    line-height: 1.4;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.app-form-group input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}

.app-form-actions {
    margin-top: 18px;
}

/* =========================================================
   Buttons
   ========================================================= */

.app-btn {
    display: inline-block;
    padding: 9px 20px;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    text-align: center;
    transition: opacity 0.2s;
}

.app-btn:hover {
    opacity: 0.85;
}

.app-btn-primary {
    background: #0073aa;
    color: #fff;
}

.app-btn.app-loading {
    opacity: 0.6;
    cursor: not-allowed;
}

/* =========================================================
   Comment Form
   ========================================================= */

.app-login-prompt {
    color: #ccc;
    font-size: 14px;
    padding: 10px 0;
}

.app-login-prompt a {
    color: #fff;
    text-decoration: underline;
    cursor: pointer;
}

.app-login-prompt a:hover {
    color: #4fc3f7;
}

#respond .logged-in-as {
    color: #ccc;
}

#respond .logged-in-as a {
    color: #fff;
}

#respond .app-guest-fields label {
    color: #ccc;
}

/* =========================================================
   Messages
   ========================================================= */

.app-auth-message {
    padding: 10px 14px;
    margin-bottom: 14px;
    border-radius: 3px;
    font-size: 13px;
    line-height: 1.4;
}

.app-msg-success {
    background: #ecf7ed;
    color: #1a7a2e;
    border: 1px solid #c3e6cb;
}

.app-msg-error {
    background: #fdf0f0;
    color: #a02020;
    border: 1px solid #f5c6cb;
}

/* =========================================================
   User Bar
   ========================================================= */

.app-user-bar {
    font-size: 13px;
    line-height: 1.5;
}

.app-user-bar-logged-in,
.app-user-bar-logged-out {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.app-user-avatar {
    border-radius: 50%;
    vertical-align: middle;
}

.app-user-sep {
    color: #999;
    margin: 0 2px;
}

.app-logout-link,
.app-login-link,
.app-register-link {
    cursor: pointer;
    text-decoration: none;
}

.app-logout-link:hover,
.app-login-link:hover,
.app-register-link:hover {
    text-decoration: underline;
}

.app-logout-link.app-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* =========================================================
   Comments (reply indicator — used by app-bridge JS)
   ========================================================= */

.app-reply-indicator {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    padding: 6px 10px;
    background: #f5f5f5;
    border-radius: 3px;
}

/* =========================================================
   Profile Modal Loading
   ========================================================= */

.app-profile-loading {
    position: relative;
    pointer-events: none;
}

.app-profile-loading .app-form {
    opacity: 0.3;
    transition: opacity 0.2s;
}

.app-profile-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: appSpinner 0.6s linear infinite;
    z-index: 10;
}

@keyframes appSpinner {
    to {
        transform: rotate(360deg);
    }
}

.app-password-toggle {
    margin: 14px 0 6px;
}

.app-password-toggle a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #93c5fd;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 14px;
    border: 1px solid rgba(147, 197, 253, 0.3);
    border-radius: 6px;
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.app-password-toggle a:hover {
    background: rgba(147, 197, 253, 0.1);
    border-color: rgba(147, 197, 253, 0.5);
    text-decoration: none;
}

.app-password-toggle a svg {
    flex-shrink: 0;
}

.app-toggle-arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.2s;
}

.app-password-toggle.active .app-toggle-arrow {
    transform: rotate(180deg);
}

.app-password-fields {
    border-left: 2px solid rgba(147, 197, 253, 0.3);
    margin-top: 10px;
    padding: 10px 0 0 14px;
}



/* =========================================================
   Video Grid
   ========================================================= */

.app-videos-grid {
    display: grid;
    gap: 20px;
}

.app-cols-1 {
    grid-template-columns: 1fr;
}

.app-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.app-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.app-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.app-video-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.app-video-card a:hover .app-video-title {
    color: #0073aa;
}

.app-video-thumb {
    position: relative;
    padding-top: 56.25%;
    overflow: hidden;
    background: #000;
    border-radius: 4px;
}

.app-video-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.2s;
}

.app-video-card a:hover .app-video-thumb img {
    opacity: 0.85;
}

.app-video-stats {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 12px;
    line-height: 1;
}

.app-stat {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

.app-stat svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.85;
}

.app-video-info {
    padding: 8px 0;
}

.app-video-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.app-video-meta {
    font-size: 12px;
    color: #999;
}

.app-video-author {
    margin-right: 8px;
}

.app-no-videos {
    color: #999;
    font-size: 14px;
    font-style: italic;
}

/* Video pagination */
.app-videos-pagination {
    margin: 24px 0;
    text-align: center;
}

.app-videos-pagination a,
.app-videos-pagination .current {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 2px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-decoration: none;
    font-size: 13px;
    color: #333;
}

.app-videos-pagination a:hover {
    background: #f5f5f5;
}

.app-videos-pagination .current {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* =========================================================
   Video Single Page
   ========================================================= */

.app-video-single {
    max-width: 960px;
    margin: 0 auto;
}

.app-video-player {
    position: relative;
    padding-top: 56.25%;
    background: #000;
    margin-bottom: 0;
}

.app-video-player iframe,
.app-video-player video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.app-video-detail {
    padding: 20px 0;
}

.app-video-detail h1 {
    font-size: 22px;
    margin: 0 0 12px;
    line-height: 1.3;
}

.app-video-single-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #666;
    margin-bottom: 16px;
}

.app-video-single-meta .app-user-avatar {
    border-radius: 50%;
}

.app-video-author-name {
    font-weight: 600;
    color: #333;
}

.app-video-single-date,
.app-video-categories {
    color: #999;
}

.app-video-categories::before {
    content: "\2022";
    margin-right: 8px;
}

.app-video-description {
    margin-top: 16px;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

/* =========================================================
   Content Images (Video Single)
   ========================================================= */

.app-content-images {
    margin: 16px 0;
}

.app-content-image {
    margin-bottom: 10px;
}

.app-content-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 768px) {

    .app-cols-3,
    .app-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .app-auth-form {
        max-width: 100%;
    }

    .app-btn {
        width: 100%;
    }

    .app-comment .children {
        margin-left: 20px;
    }

    .app-cols-2,
    .app-cols-3,
    .app-cols-4 {
        grid-template-columns: 1fr;
    }

    .app-video-detail h1 {
        font-size: 18px;
    }
}