/* General Container */
.ultimate-anime-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: inherit;
    border: 2px solid #ff4c4c;
    border-radius: 15px;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
}

/* Header Section */
.ultimate-anime-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: inherit;
    border: 1px solid #ff4c4c;
    border-radius: 10px;
}

.ultimate-anime-poster {
    flex: 0 0 200px;
}

.ultimate-anime-poster img {
    width: 100%;
    max-height: 340px; /* Increased to show full image */
    object-fit: contain; /* Ensures full image is visible */
    border-radius: 10px;
    border: 2px solid #ff4c4c;
    transition: transform 0.3s ease;
}

.ultimate-anime-poster img:hover {
    transform: scale(1.05);
}

.ultimate-anime-title-wrapper {
    flex: 1;
}

.ultimate-anime-title-wrapper h1 {
    font-size: clamp(1.5rem, 4vw, 2.2rem); /* Adjusted for better scaling */
    margin: 0 0 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.2;
    animation: fadeIn 1s ease-out;
}

.ultimate-anime-title {
    font-size: clamp(0.8rem, 2.5vw, 1rem);
    font-style: italic;
    display: block;
    margin-bottom: 5px;
}

/* Details Section */
.ultimate-anime-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    padding: 15px;
    background: inherit;
    border: 1px solid #00d4ff;
    border-radius: 5px;
    margin-bottom: 20px;
}

.ultimate-anime-detail-item {
    display: flex;
    flex-direction: row; /* Changed to row for tighter alignment */
    align-items: center;
    padding: 10px;
    background: inherit;
    border: 1px solid #ff4c4c;
    border-radius: 5px;
    transition: transform 0.2s ease;
}

.ultimate-anime-detail-item:hover {
    transform: translateY(-3px);
}

.ultimate-anime-detail-item .label {
    font-size: clamp(0.7rem, 2vw, 0.85rem);
    color: inherit; /* Respects theme color */
    font-weight: bold;
    text-transform: uppercase;
    margin-right: 5px;
    flex: 0 0 auto;
}

.ultimate-anime-detail-item .value {
    font-size: clamp(0.8rem, 2.2vw, 1rem);
    flex: 1;
}

.ultimate-anime-links .value a {
    color: #00d4ff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ultimate-anime-links .value a:hover {
    color: #ff4c4c;
    text-decoration: underline;
}

/* Synopsis Section */
.ultimate-anime-synopsis {
    margin-bottom: 15px;
    padding: 15px;
    background: inherit;
    border-left: 4px solid #ff4c4c;
    border-radius: 3px;
}

.ultimate-anime-synopsis .title {
    font-size: clamp(1.3rem, 3.5vw, 1.6rem);
    margin-bottom: 10px;
    text-transform: capitalize;
    letter-spacing: 0.5px;
}

.ultimate-anime-synopsis .p {
    font-size: clamp(0.85rem, 2.5vw, 1rem);
    line-height: 1.5;
}

/* Trailer Section */
.ultimate-anime-trailer {
    margin-bottom:30px;
}

.ultimate-anime-trailer .title {
    font-size: clamp(1.3rem, 3.5vw, 1.6rem);
    margin: 0 0 10px;
    text-transform: capitalize;
    letter-spacing: 0.5px;
}

.ultimate-anime-trailer .trail-wrapper {
    position: relative;
    border-radius: 7px;
    border: 2px solid #00d4ff;
    overflow: hidden;
}

.ultimate-anime-trailer iframe {
    position: relative;
    top: 0;
    left: 0;
    height: 300px;
    width: auto;
    border: none;
    margin: 0;
    padding: 0;
}

/* Slider Styles */
.ultimate-anime-character-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin: 20px 0;
}

.ultimate-anime-character-slider .slider-wrapper {
    display: flex;
    will-change: transform;
    width: 100%;
    touch-action: pan-y;
}

.ultimate-anime-character-slider .character-item {
    flex: 0 0 auto;
    box-sizing: border-box;
    padding: 10px;
    text-align: center;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.7;
}

.ultimate-anime-character-slider .character-item.active {
    opacity: 1;
    transform: scale(1.05);
}

.ultimate-anime-character-slider .character-image img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.ultimate-anime-character-slider .character-details {
    margin-top: 10px;
}

.ultimate-anime-character-slider .character-name {
    font-size: 14px;
    font-weight: bold;
    display: block;
}

.ultimate-anime-character-slider .character-role {
    font-size: 12px;
}

.ultimate-anime-character-slider .name-length-0,
.ultimate-anime-character-slider .name-length-1,
.ultimate-anime-character-slider .name-length-2,
.ultimate-anime-character-slider .name-length-3,
.ultimate-anime-character-slider .name-length-4,
.ultimate-anime-character-slider .name-length-5,
.ultimate-anime-character-slider .name-length-6,
.ultimate-anime-character-slider .name-length-7,
.ultimate-anime-character-slider .name-length-8,
.ultimate-anime-character-slider .name-length-9,
.ultimate-anime-character-slider .name-length-10 {
    font-size: 14px;
}

.ultimate-anime-character-slider .name-length-11,
.ultimate-anime-character-slider .name-length-12,
.ultimate-anime-character-slider .name-length-13,
.ultimate-anime-character-slider .name-length-14,
.ultimate-anime-character-slider .name-length-15 {
    font-size: 13px;
}

.ultimate-anime-character-slider .name-length-16,
.ultimate-anime-character-slider .name-length-17,
.ultimate-anime-character-slider .name-length-18,
.ultimate-anime-character-slider .name-length-19,
.ultimate-anime-character-slider .name-length-20 {
    font-size: 12px;
}

.ultimate-anime-character-slider .name-length-21,
.ultimate-anime-character-slider .name-length-22,
.ultimate-anime-character-slider .name-length-23,
.ultimate-anime-character-slider .name-length-24,
.ultimate-anime-character-slider .name-length-25,
.ultimate-anime-character-slider .name-length-26,
.ultimate-anime-character-slider .name-length-27,
.ultimate-anime-character-slider .name-length-28,
.ultimate-anime-character-slider .name-length-29,
.ultimate-anime-character-slider .name-length-30 {
    font-size: 11px;
}

.ultimate-anime-character-slider .slider-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
}

.ultimate-anime-character-slider .slider-prev,
.ultimate-anime-character-slider .slider-next,
.ultimate-anime-character-slider .slider-play-pause {
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin: 0 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.ultimate-anime-character-slider .slider-prev:hover,
.ultimate-anime-character-slider .slider-next:hover,
.ultimate-anime-character-slider .slider-play-pause:hover {
    background: #005177;
}

.ultimate-anime-character-slider .slider-prev:disabled,
.ultimate-anime-character-slider .slider-next:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.ultimate-anime-character-slider .dashicons {
    font-size: 20px;
}

.ultimate-anime-character-slider .slider-dots {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.ultimate-anime-character-slider .slider-dot {
    width: 10px;
    height: 10px;
    background: #ccc;
    border-radius: 50%;
    margin: 0 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.ultimate-anime-character-slider .slider-dot.active {
    background: #0073aa;
}

.ultimate-anime-character-slider .slider-dot:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.jannah-theme .ultimate-anime-character-slider {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
}

@media (max-width: 1024px) {
    .ultimate-anime-character-slider .character-image img {
        height: 240px;
    }
}

@media (max-width: 768px) {
    .ultimate-anime-character-slider .character-image img {
        height: 200px;
    }
    .ultimate-anime-character-slider .character-name {
        font-size: 13px;
    }
    .ultimate-anime-character-slider .character-role {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .ultimate-anime-character-slider .character-image img {
        height: 180px;
    }
    .ultimate-anime-character-slider .character-name {
        font-size: 12px;
    }
    .ultimate-anime-character-slider .character-role {
        font-size: 10px;
    }
    .ultimate-anime-character-slider .slider-prev,
    .ultimate-anime-character-slider .slider-next,
    .ultimate-anime-character-slider .slider-play-pause {
        width: 35px;
        height: 35px;
    }
    .ultimate-anime-character-slider .dashicons {
        font-size: 18px;
    }
}

/* Jannah Theme Adjustments for Non-Slider Sections */
.jannah-theme .ultimate-anime-container {
    background: inherit;
    color: #333;
    border: 2px solid #e91e63;
}

.jannah-theme .ultimate-anime-header {
    background: inherit;
    border: 1px solid #e91e63;
}

.jannah-theme .ultimate-anime-title-wrapper h1 {
    color: #e91e63;
}

.jannah-theme .ultimate-anime-english-title {
    color: #666;
}

.jannah-theme .ultimate-anime-detail-item {
    background: inherit;
    border: 1px solid #e91e63;
}

.jannah-theme .ultimate-anime-detail-item .label {
    color: inherit;
}

.jannah-theme .ultimate-anime-detail-item .value {
    color: #333;
}

.jannah-theme .ultimate-anime-links .value a {
    color: #0073aa;
}

.jannah-theme .ultimate-anime-links .value a:hover {
    color: #e91e63;
}

.jannah-theme .ultimate-anime-synopsis,
.jannah-theme .ultimate-anime-faqs .faq-item,
.jannah-theme .ultimate-anime-reviews .review-item {
    border-left-color: #e91e63;
}

.jannah-theme .ultimate-anime-synopsis h2,
.jannah-theme .ultimate-anime-trailer h2,
.jannah-theme .ultimate-anime-faqs h2,
.jannah-theme .ultimate-anime-recommendations h2,
.jannah-theme .ultimate-anime-reviews h2 {
    color: #e91e63;
}

.jannah-theme .ultimate-anime-synopsis p,
.jannah-theme .ultimate-anime-faqs .faq-item p,
.jannah-theme .ultimate-anime-reviews .review-item p {
    color: #555;
}

.jannah-theme .ultimate-anime-recommendations li {
    background: inherit;
    border: 1px solid #e91e63;
    color: #333;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Adjustments for Non-Slider Sections */
@media (max-width: 1024px) {
    .ultimate-anime-header {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    .ultimate-anime-poster {
        flex: 0 0 240px;
    }
}

@media (max-width: 768px) {
    .ultimate-anime-container {
        padding: 10px;
    }
    .ultimate-anime-details {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .ultimate-anime-poster {
        flex: 0 0 200px;
    }
}

@media (max-width: 480px) {
    .ultimate-anime-poster {
        flex: 0 0 160px;
    }
    .ultimate-anime-header,
    .ultimate-anime-details,
    .ultimate-anime-synopsis,
    .ultimate-anime-faqs .faq-item,
    .ultimate-anime-reviews .review-item {
        padding: 8px;
    }
}

.ultimate-anime-episodes {
    margin-top: 20px;
}
.episode-list {
    display: grid;
    gap: 20px;
}
.episode-item {
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 5px;
}
.episode-item h3 {
    margin: 0 0 10px;
    font-size: 1.2em;
}
.ultimate-anime-streaming .value a {
    margin-right: 10px;
    text-decoration: none;
    color: #0073aa;
}
.ultimate-anime-streaming .value a:hover {
    text-decoration: underline;
}