/* ========================================
   THENETWORK THUMBNAIL LOADER
   Spinner animation and thumbnail overlay styles
   ======================================== */

/* ========================================
   LOADER VARIABLE
   ======================================== */
:root {
    --loader-size: 60px;
}

/* ========================================
   THUMBNAIL CONTAINER
   ======================================== */

.thumbnails-container {
    position: relative;
    width: 288px;
    height: 162px;
    float: left;
    margin-right: 15px;
    margin-bottom: 10px;
}

.thumbnails {
    width: 288px;
    height: 162px;
    object-fit: cover;
    border-radius: 4px;
}

/* ========================================
   OVERLAY CONTAINER
   ======================================== */

.res-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    border-radius: 4px;
}

/* Ensure loader is visible */
.res-container .loader {
    z-index: 10;
}

/* Position res-container correctly over thumbnail */
.thumbnails-container .res-container {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 288px;
    height: 162px;
    background: rgba(0,0,0,0.85);
    border-radius: 4px;
    z-index: 5;
}

.thumbnails-container .res-container.show {
    display: block;
}

/* ========================================
   OVERLAY TEXT
   ======================================== */

.overlay-text {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    color: var(--tn-text-muted, #999);
    font-size: 12px;
    text-align: center;
}

/* Thumbnail-specific overlay text with better visibility */
.thumbnails-container .overlay-text {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    color: var(--tn-text-inverse, #ffffff);
    font-size: 14px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    z-index: 10;
}

.thumbnails-container .overlay-text b {
    color: var(--tn-primary, #ff9c00);
}

/* ========================================
   LOADER ANIMATION - Three Ring Spinner
   Uses theme accent colors:
   - Outer ring: --tn-secondary (teal)
   - Middle ring: --tn-tertiary (red-orange)
   - Inner ring: --tn-primary (orange)
   ======================================== */

.loader {
    width: var(--loader-size);
    height: var(--loader-size);
    border-radius: 50%;
    display: inline-block;
    border: 3px solid;
    border-color: var(--tn-secondary, #14947c) var(--tn-secondary, #14947c) transparent var(--tn-secondary, #14947c);
    box-sizing: border-box;
    animation: rotation 1.5s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.loader::after,
.loader::before {
    content: '';
    box-sizing: border-box;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    margin: auto;
    border: 3px solid;
    border-color: transparent transparent var(--tn-tertiary, #FF3D00) var(--tn-tertiary, #FF3D00);
    width: calc(var(--loader-size) - 12px);
    height: calc(var(--loader-size) - 12px);
    border-radius: 50%;
    animation: rotationBack 0.7s linear infinite;
}

.loader::before {
    width: calc(var(--loader-size) - 24px);
    height: calc(var(--loader-size) - 24px);
    border-color: var(--tn-primary, #ff9c00) var(--tn-primary, #ff9c00) transparent transparent;
    animation: rotation 2s linear infinite;
}

/* ========================================
   KEYFRAME ANIMATIONS
   ======================================== */

@keyframes rotation {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

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

/* ========================================
   LOADER POSITIONING FOR THUMBNAILS
   ======================================== */

/* Loader spinner in center of thumbnail - PROPERLY ALIGNED */
.thumbnails-container .loader.overlay-image {
    position: absolute;
    top: 50%;
    left: 50%;
    margin-left: -30px;  /* Half of loader-size (60px / 2) */
    margin-top: -30px;   /* Half of loader-size (60px / 2) */
    width: var(--loader-size);
    height: var(--loader-size);
}

/* Loader inherits the base .loader styles */
.thumbnails-container .overlay-image {
    /* Base .loader class handles centering correctly */
}
