.themes-popup-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
backdrop-filter: blur(8px);
z-index: 10001;
display: none;
align-items: center;
justify-content: center;
padding: 1rem;
opacity: 0;
transition: opacity 0.2s ease;
}

@media (max-width: 768px) {
.themes-popup-overlay {
padding: 0;
align-items: flex-end;
}
}

.themes-popup-overlay.show {
display: flex;
opacity: 1;
}

.themes-popup-content {
width: 100%;
max-width: 500px;
background: #1e2433;
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 12px;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
overflow: hidden;
position: relative;
animation: themesPopupSlideIn 0.2s ease-out;
display: flex;
flex-direction: column;
max-height: 90vh;
}

@media (max-width: 768px) {
.themes-popup-content {
width: 100%;
max-width: none;
height: auto;
max-height: 90vh;
border-radius: 12px 12px 0 0;
border: 1px solid rgba(255, 255, 255, 0.1);
box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
animation: themesPopupSlideUp 0.3s ease-out;
overflow-y: auto;
}
}

@keyframes themesPopupSlideIn {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}

@keyframes themesPopupSlideOut {
from {
opacity: 1;
transform: translateY(0);
}
to {
opacity: 0;
transform: translateY(10px);
}
}

@keyframes themesPopupSlideUp {
from {
opacity: 0;
transform: translateY(100%);
}
to {
opacity: 1;
transform: translateY(0);
}
}

@keyframes themesPopupSlideDown {
from {
opacity: 1;
transform: translateY(0);
}
to {
opacity: 0;
transform: translateY(100%);
}
}

.themes-popup-content.closing {
animation: themesPopupSlideOut 0.2s ease-out forwards;
}

@media (max-width: 768px) {
.themes-popup-content.closing {
animation: themesPopupSlideDown 0.3s ease-out forwards;
}
}

.themes-popup-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20px;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
background: rgba(0, 0, 0, 0.2);
flex-shrink: 0;
}

.themes-popup-title-wrapper {
display: flex;
align-items: center;
gap: 16px;
flex: 1;
min-width: 0;
}

.themes-popup-icon {
width: 40px;
height: 40px;
color: #8b5cf6;
flex-shrink: 0;
}

.themes-popup-title {
font-size: 20px;
font-weight: 700;
color: white;
margin: 0;
display: flex;
align-items: center;
gap: 8px;
}

.themes-popup-subtitle {
font-size: 13px;
color: rgba(255, 255, 255, 0.5);
margin: 4px 0 0 0;
}

.themes-popup-beta {
background: transparent;
color: #667eea;
font-size: 9px;
font-weight: 800;
padding: 2px 6px;
border-radius: 3px;
letter-spacing: 0.8px;
text-transform: uppercase;
border: 1.5px solid #667eea;
box-shadow: 0 0 10px rgba(102, 126, 234, 0.4);
display: inline-block;
}

.themes-popup-close {
background: transparent;
border: none;
color: rgba(255, 255, 255, 0.6);
cursor: pointer;
padding: 4px;
border-radius: 4px;
transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
}

.themes-popup-close:hover {
color: white;
background: rgba(255, 255, 255, 0.1);
}

.themes-popup-body {
padding: 16px;
overflow-y: auto;
flex: 1;
}

.themes-warning {
display: flex;
align-items: flex-start;
gap: 12px;
padding: 12px;
background: rgba(251, 191, 36, 0.1);
border: 1px solid rgba(251, 191, 36, 0.3);
border-radius: 8px;
margin-bottom: 16px;
}

.themes-warning-icon {
width: 20px;
height: 20px;
color: #fbbf24;
flex-shrink: 0;
margin-top: 2px;
}

.themes-warning p {
color: rgba(255, 255, 255, 0.8);
font-size: 13px;
line-height: 1.5;
margin: 0;
}

.themes-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 12px;
}

@media (max-width: 768px) {
.themes-grid {
grid-template-columns: 1fr;
gap: 10px;
}
}

.theme-card {
background: rgba(255, 255, 255, 0.03);
border: 2px solid rgba(255, 255, 255, 0.1);
border-radius: 10px;
padding: 10px;
cursor: pointer;
transition: all 0.2s ease;
position: relative;
}

.theme-card:hover {
background: rgba(255, 255, 255, 0.05);
border-color: rgba(255, 255, 255, 0.2);
transform: translateY(-1px);
}

.theme-card.active {
border-color: #8b5cf6;
background: rgba(139, 92, 246, 0.08);
}

.theme-card.active::before {
content: '';
position: absolute;
inset: 0;
border-radius: 10px;
padding: 2px;
background: linear-gradient(135deg, #8b5cf6 0%, #667eea 100%);
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
-webkit-mask-composite: xor;
mask-composite: exclude;
pointer-events: none;
}

.theme-thumbnail {
width: 100%;
aspect-ratio: 16/9;
border-radius: 6px;
overflow: hidden;
margin-bottom: 8px;
position: relative;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.theme-preview-navbar {
height: 18%;
width: 100%;
background: transparent;
}

.theme-preview-content {
height: 82%;
width: 100%;
background: transparent;
}

.theme-default {
background: linear-gradient(90deg, #252B3D 0%, #252B3D 49.99%, #1A1F2E 50%, #1A1F2E 100%);
}

.theme-cinematic img {
width: 100%;
height: 100%;
object-fit: cover;
}

.theme-pink-glow {
background: linear-gradient(to right, #FF6B9D 0%, #FF6B9D 50%, #1a1a1a 50%, #1a1a1a 100%);
position: relative;
}

.theme-pink-glow::after {
content: '';
position: absolute;
left: 50%;
top: 0;
bottom: 0;
width: 1px;
background: rgba(0, 0, 0, 0.3);
transform: translateX(-0.5px);
}

.theme-electric-yellow {
background: linear-gradient(to right, #FEFF04 0%, #FEFF04 50%, #212121 50%, #212121 100%);
position: relative;
}

.theme-electric-yellow::after {
content: '';
position: absolute;
left: 50%;
top: 0;
bottom: 0;
width: 1px;
background: rgba(0, 0, 0, 0.3);
transform: translateX(-0.5px);
}

.theme-info {
margin-bottom: 4px;
}

.theme-name {
font-size: 14px;
font-weight: 600;
color: white;
margin: 0 0 2px 0;
}

.theme-card.active .theme-name {
color: #a78bfa;
}

.theme-description {
font-size: 12px;
color: rgba(255, 255, 255, 0.5);
margin: 0;
}

.theme-check {
position: absolute;
top: 14px;
right: 14px;
width: 20px;
height: 20px;
background: #8b5cf6;
border-radius: 50%;
display: none;
align-items: center;
justify-content: center;
color: white;
box-shadow: 0 2px 8px rgba(139, 92, 246, 0.5);
}

.theme-check svg {
width: 12px;
height: 12px;
}

.theme-card.active .theme-check {
display: flex;
}

@media (max-width: 768px) {
.themes-popup-header {
padding: 16px;
}

.themes-popup-title-wrapper {
gap: 10px;
}

.themes-popup-icon {
width: 28px;
height: 28px;
}

.themes-popup-title {
font-size: 16px;
}

.themes-popup-subtitle {
font-size: 12px;
}

.themes-popup-body {
padding: 12px;
}

.theme-card {
padding: 8px;
}

.theme-thumbnail {
margin-bottom: 6px;
}
}
