/*
Theme Name: Ringat
Theme URI: https://ringat.com
Author: Ringat Team
Author URI: https://ringat.com
Description: A modern WordPress theme for ringtone download websites. Features include PWA support, dark mode, RTL support, and optimized performance.
Version: 1.0.0
Requires at least: 5.9
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ringat
Domain Path: /languages
Tags: rtl-language-support, translation-ready, custom-colors, custom-menu, featured-images

Ringat - Ringtone Download Theme
*/

:root {
    --ringat-primary: #6366f1;
    --ringat-primary-dark: #4f46e5;
    --ringat-secondary: #f59e0b;
    --ringat-bg: #ffffff;
    --ringat-bg-secondary: #f8fafc;
    --ringat-text: #1e293b;
    --ringat-text-secondary: #64748b;
    --ringat-border: #e2e8f0;
}

.dark {
    --ringat-primary: #818cf8;
    --ringat-primary-dark: #6366f1;
    --ringat-secondary: #fbbf24;
    --ringat-bg: #0f172a;
    --ringat-bg-secondary: #1e293b;
    --ringat-text: #f1f5f9;
    --ringat-text-secondary: #94a3b8;
    --ringat-border: #334155;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--ringat-bg);
    color: var(--ringat-text);
    line-height: 1.6;
}

/* Hide scrollbar for category slider */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Audio player animations */
@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.3); opacity: 0; }
}

@keyframes wave {
    0%, 100% { height: 3px; }
    50% { height: 12px; }
}

@keyframes wave-small {
    0%, 100% { height: 2px; }
    50% { height: 8px; }
}

.audio-wave span {
    display: inline-block;
    width: 2px;
    min-height: 2px;
    background-color: currentColor;
    border-radius: 1px;
    animation: wave-small 0.6s ease-in-out infinite;
}

.audio-wave span:nth-child(1) { animation-delay: 0s; }
.audio-wave span:nth-child(2) { animation-delay: 0.15s; }
.audio-wave span:nth-child(3) { animation-delay: 0.3s; }
.audio-wave span:nth-child(4) { animation-delay: 0.45s; }

/* Large wave for single page */
.ringtone-single .audio-wave span {
    width: 3px;
    animation: wave 0.8s ease-in-out infinite;
}

.ringtone-single .audio-wave span:nth-child(5) { animation-delay: 0.5s; }

.pulse-animation {
    animation: pulse-ring 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Card hover effects */
.ringtone-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ringtone-card:hover {
    transform: translateY(-2px);
}

/* Play button pulse */
@keyframes play-pulse {
    0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0); }
    100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

.ringtone-card.ring-2 .card-play-btn .pause-icon {
    animation: play-pulse 1.5s infinite;
}

/* Audio Visualizer Bars */
@keyframes visualizer-1 { 0%, 100% { height: 8px; } 50% { height: 32px; } }
@keyframes visualizer-2 { 0%, 100% { height: 16px; } 50% { height: 40px; } }
@keyframes visualizer-3 { 0%, 100% { height: 12px; } 50% { height: 28px; } }
@keyframes visualizer-4 { 0%, 100% { height: 20px; } 50% { height: 44px; } }
@keyframes visualizer-5 { 0%, 100% { height: 10px; } 50% { height: 36px; } }

.visualizer-bar {
    height: 8px;
    transition: height 0.1s ease;
}

.visualizer-active .visualizer-bar {
    animation-duration: 0.5s;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
}

.visualizer-active .visualizer-bar:nth-child(1) { animation-name: visualizer-1; animation-delay: 0s; }
.visualizer-active .visualizer-bar:nth-child(2) { animation-name: visualizer-2; animation-delay: 0.1s; }
.visualizer-active .visualizer-bar:nth-child(3) { animation-name: visualizer-3; animation-delay: 0.05s; }
.visualizer-active .visualizer-bar:nth-child(4) { animation-name: visualizer-4; animation-delay: 0.15s; }
.visualizer-active .visualizer-bar:nth-child(5) { animation-name: visualizer-5; animation-delay: 0.08s; }
.visualizer-active .visualizer-bar:nth-child(6) { animation-name: visualizer-1; animation-delay: 0.12s; }
.visualizer-active .visualizer-bar:nth-child(7) { animation-name: visualizer-2; animation-delay: 0.02s; }
.visualizer-active .visualizer-bar:nth-child(8) { animation-name: visualizer-3; animation-delay: 0.18s; }
.visualizer-active .visualizer-bar:nth-child(9) { animation-name: visualizer-4; animation-delay: 0.07s; }
.visualizer-active .visualizer-bar:nth-child(10) { animation-name: visualizer-5; animation-delay: 0.13s; }
.visualizer-active .visualizer-bar:nth-child(11) { animation-name: visualizer-1; animation-delay: 0.04s; }
.visualizer-active .visualizer-bar:nth-child(12) { animation-name: visualizer-2; animation-delay: 0.16s; }
.visualizer-active .visualizer-bar:nth-child(13) { animation-name: visualizer-3; animation-delay: 0.09s; }
.visualizer-active .visualizer-bar:nth-child(14) { animation-name: visualizer-4; animation-delay: 0.03s; }
.visualizer-active .visualizer-bar:nth-child(15) { animation-name: visualizer-5; animation-delay: 0.14s; }
.visualizer-active .visualizer-bar:nth-child(16) { animation-name: visualizer-1; animation-delay: 0.06s; }
.visualizer-active .visualizer-bar:nth-child(17) { animation-name: visualizer-2; animation-delay: 0.11s; }
.visualizer-active .visualizer-bar:nth-child(18) { animation-name: visualizer-3; animation-delay: 0.17s; }
.visualizer-active .visualizer-bar:nth-child(19) { animation-name: visualizer-4; animation-delay: 0.01s; }
.visualizer-active .visualizer-bar:nth-child(20) { animation-name: visualizer-5; animation-delay: 0.19s; }

/* Paused state - bars stay still */
.visualizer-paused .visualizer-bar {
    animation-play-state: paused;
}

/* Progress bar handle */
#audio-progress-bar:hover #audio-progress-handle {
    opacity: 1;
}

/* Drawer animation */
.drawer-overlay {
    transition: opacity 0.3s ease;
}

.drawer-content {
    transition: transform 0.3s ease;
}

/* RTL specific */
[dir="rtl"] .drawer-content {
    transform: translateX(100%);
}

[dir="ltr"] .drawer-content {
    transform: translateX(-100%);
}

.drawer-open .drawer-content {
    transform: translateX(0) !important;
}

/* Progress bar for audio */
.audio-progress {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 2px;
    background: var(--ringat-border);
    cursor: pointer;
}

.audio-progress::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--ringat-primary);
    cursor: pointer;
}

.audio-progress::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--ringat-primary);
    cursor: pointer;
    border: none;
}

/* Loading spinner */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner {
    animation: spin 1s linear infinite;
}

/* Countdown animation */
@keyframes countdown-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.countdown-number {
    animation: countdown-pulse 1s ease-in-out infinite;
}

/* ============================================
   Ringtone Action Buttons (Listen & Download)
   ============================================ */

.ringtone-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 140px;
    height: 48px;
    padding: 0 24px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.ringtone-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255,255,255,0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ringtone-btn:hover::before {
    opacity: 1;
}

.ringtone-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.ringtone-btn:active {
    transform: translateY(-1px);
}

/* Listen Button */
.ringtone-btn-listen {
    background: linear-gradient(135deg, var(--ringat-primary) 0%, var(--ringat-primary-dark) 100%);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.ringtone-btn-listen:hover {
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

/* Download Button */
.ringtone-btn-download {
    background: linear-gradient(-89deg, #fb00ff, #fd3198 32%, #fe4d5d 70%, #ff7900);
    box-shadow: 0 4px 15px rgba(253, 49, 152, 0.3);
}

.ringtone-btn-download:hover {
    box-shadow: 0 10px 30px rgba(253, 49, 152, 0.4);
}

/* Button shine animation on hover */
.ringtone-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.5s ease;
}

.ringtone-btn:hover::after {
    left: 100%;
}

/* ============================================
   Search Box Gradient Border
   ============================================ */

.search-gradient-wrapper {
    position: relative;
    padding: 2px;
    border-radius: 14px;
    background: linear-gradient(-89deg, #fb00ff, #fd3198 32%, #fe4d5d 70%, #ff7900);
}

.search-gradient-wrapper > div {
    background: var(--ringat-bg);
    border-radius: 12px;
}

.dark .search-gradient-wrapper > div {
    background: #1e293b;
}

/* ============================================
   Fixed Bottom Audio Player
   ============================================ */

.fixed-audio-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fixed-audio-player.active {
    transform: translateY(0);
}

.fixed-player-backdrop {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.95) 0%, rgba(79, 70, 229, 0.98) 50%, rgba(67, 56, 202, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.dark .fixed-player-backdrop {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.98) 100%);
    border-top: 1px solid rgba(99, 102, 241, 0.3);
}

.fixed-player-content {
    position: relative;
    z-index: 2;
    overflow: hidden;
}

/* Animated Background Waves */
.fixed-player-waves {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.wave {
    position: absolute;
    bottom: 0;
    left: -50%;
    width: 200%;
    height: 100px;
    background: linear-gradient(transparent, rgba(255, 255, 255, 0.05));
    border-radius: 100% 100% 0 0;
    animation: wave-float 8s ease-in-out infinite;
}

.wave-1 {
    animation-delay: 0s;
    opacity: 0.3;
}

.wave-2 {
    animation-delay: -2s;
    opacity: 0.2;
    height: 80px;
}

.wave-3 {
    animation-delay: -4s;
    opacity: 0.1;
    height: 60px;
}

@keyframes wave-float {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(2%) translateY(-5px); }
    50% { transform: translateX(0) translateY(-10px); }
    75% { transform: translateX(-2%) translateY(-5px); }
}

.fixed-audio-player.playing .wave {
    animation-duration: 3s;
}

/* Progress Bar */
.fixed-progress-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
}

.fixed-progress-bar {
    position: relative;
    height: 100%;
    cursor: pointer;
    transition: height 0.2s ease;
}

.fixed-progress-wrapper:hover .fixed-progress-bar {
    height: 6px;
    margin-top: -3px;
}

.fixed-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #fbbf24, #f59e0b, #fbbf24);
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
    border-radius: 0 2px 2px 0;
    transition: width 0.1s linear;
}

.fixed-progress-glow {
    position: absolute;
    top: -2px;
    left: 0%;
    width: 8px;
    height: 8px;
    background: #fbbf24;
    border-radius: 50%;
    box-shadow: 0 0 10px #fbbf24, 0 0 20px #fbbf24;
    opacity: 0;
    transition: opacity 0.2s, left 0.1s linear;
}

.fixed-progress-wrapper:hover .fixed-progress-glow {
    opacity: 1;
}

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

/* Player Thumbnail */
.fixed-player-thumb {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.fixed-player-thumb img {
    transition: transform 0.5s ease;
}

.fixed-audio-player.playing .fixed-player-thumb img {
    transform: scale(1.1);
}

.thumb-pulse {
    position: absolute;
    inset: -4px;
    border: 2px solid rgba(251, 191, 36, 0.5);
    border-radius: 14px;
    opacity: 0;
    animation: thumb-pulse-anim 2s ease-out infinite;
}

.fixed-audio-player.playing .thumb-pulse {
    opacity: 1;
}

@keyframes thumb-pulse-anim {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.3); opacity: 0; }
}

/* Thumbnail Visualizer */
.thumb-visualizer {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fixed-audio-player.playing .thumb-visualizer {
    opacity: 1;
}

.thumb-visualizer span {
    width: 3px;
    background: linear-gradient(to top, #fbbf24, #fff);
    border-radius: 2px;
    animation: thumb-bar 0.5s ease-in-out infinite;
}

.thumb-visualizer span:nth-child(1) { animation-delay: 0s; }
.thumb-visualizer span:nth-child(2) { animation-delay: 0.1s; }
.thumb-visualizer span:nth-child(3) { animation-delay: 0.2s; }
.thumb-visualizer span:nth-child(4) { animation-delay: 0.1s; }
.thumb-visualizer span:nth-child(5) { animation-delay: 0s; }

@keyframes thumb-bar {
    0%, 100% { height: 4px; }
    50% { height: 14px; }
}

/* Circular Visualizer */
.circular-visualizer {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: none;
}

@media (min-width: 640px) {
    .circular-visualizer {
        display: block;
    }
}

.circle-bar {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3px;
    height: 8px;
    background: linear-gradient(to top, rgba(251, 191, 36, 0.3), rgba(251, 191, 36, 0.8));
    border-radius: 2px;
    transform-origin: center 22px;
    transform: translateX(-50%) rotate(calc(var(--i) * 30deg));
    transition: height 0.1s ease, background 0.3s ease;
}

.fixed-audio-player.playing .circle-bar {
    animation: circle-bar-anim 0.6s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.05s);
    background: linear-gradient(to top, #fbbf24, #fff);
}

@keyframes circle-bar-anim {
    0%, 100% { height: 6px; }
    50% { height: 16px; }
}

/* Control Buttons */
.fixed-control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fixed-play-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1e293b;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
}

.fixed-play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.5);
}

.fixed-play-btn:active {
    transform: scale(0.95);
}

.fixed-audio-player.playing .fixed-play-btn {
    animation: play-btn-pulse 2s ease-in-out infinite;
}

@keyframes play-btn-pulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4); }
    50% { box-shadow: 0 4px 25px rgba(251, 191, 36, 0.7), 0 0 40px rgba(251, 191, 36, 0.3); }
}

.fixed-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.fixed-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: rotate(90deg);
}

/* Loading State */
.fixed-audio-player.loading .fixed-play-btn {
    pointer-events: none;
}

.fixed-audio-player.loading .fixed-play-btn .play-icon svg,
.fixed-audio-player.loading .fixed-play-btn .pause-icon svg {
    display: none;
}

.fixed-audio-player.loading .fixed-play-btn::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 3px solid transparent;
    border-top-color: #1e293b;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Paused state - dim slightly */
.fixed-audio-player.paused .fixed-player-backdrop {
    opacity: 0.95;
}

.fixed-audio-player.paused .thumb-visualizer span,
.fixed-audio-player.paused .circle-bar {
    animation-play-state: paused;
}

/* Dark mode adjustments */
.dark .fixed-play-btn {
    background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.dark .fixed-play-btn:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.dark .fixed-audio-player.playing .fixed-play-btn {
    animation-name: play-btn-pulse-dark;
}

@keyframes play-btn-pulse-dark {
    0%, 100% { box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4); }
    50% { box-shadow: 0 4px 25px rgba(99, 102, 241, 0.7), 0 0 40px rgba(99, 102, 241, 0.3); }
}

.dark .thumb-visualizer span {
    background: linear-gradient(to top, #818cf8, #fff);
}

.dark .circle-bar {
    background: linear-gradient(to top, rgba(129, 140, 248, 0.3), rgba(129, 140, 248, 0.8));
}

.dark .fixed-audio-player.playing .circle-bar {
    background: linear-gradient(to top, #818cf8, #fff);
}

.dark .fixed-progress-fill {
    background: linear-gradient(90deg, #818cf8, #6366f1, #818cf8);
    background-size: 200% 100%;
}

.dark .fixed-progress-glow {
    background: #818cf8;
    box-shadow: 0 0 10px #818cf8, 0 0 20px #818cf8;
}

.dark .thumb-pulse {
    border-color: rgba(129, 140, 248, 0.5);
}

/* ============================================
   RingZoya Logo Animation
   ============================================ */

.ringzoya-logo {
    color: var(--ringat-text);
    transition: color 0.3s ease;
}

.ringzoya-r,
.ringzoya-z {
    display: inline-block;
    background: linear-gradient(-89deg, #fb00ff, #fd3198 32%, #fe4d5d 70%, #ff7900);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 100%;
    animation: gradient-shift 3s ease infinite;
    font-weight: 800;
    position: relative;
}

.ringzoya-z {
    animation: gradient-shift 3s ease infinite reverse;
    animation-delay: 0.5s;
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.dark .ringzoya-r,
.dark .ringzoya-z {
    background: linear-gradient(-89deg, #818cf8, #a78bfa 25%, #fb00ff 50%, #fd3198 75%, #f59e0b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 100%;
}

/* Hover effect */
.ringzoya-logo:hover .ringzoya-r,
.ringzoya-logo:hover .ringzoya-z {
    animation-duration: 1.5s;
}