:root {
    --bg: #0f172a;
    --card: #1e293b;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --glass: rgba(30, 41, 59, 0.9);
    --border: #334155;
    --success: #10b981;
    --shadow-elevation: 0 10px 30px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 20px 40px rgba(139, 92, 246, 0.3);
}

#rt-app {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background: transparent;
    min-height: 100vh;
    padding: 2rem 0;
    width: 95% !important;
    max-width: 1600px !important; /* Cinematic Width */
    margin: 0 auto;
    box-sizing: border-box;
}

.rt-wrapper {
    max-width: 100% !important;
}

/* --- FILTRAI (HEADER) --- */
.rt-filters-container {
    background: var(--glass);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-elevation);
    max-width: 100%;
}

.rt-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.rt-tabs button {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted);
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 8px;
    font-size: 0.95rem;
    white-space: nowrap;
}

.rt-tabs button:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
}

.rt-tabs button.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

.rt-search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    flex: 1;
    justify-content: flex-end;
    align-items: center;
}

.rt-input {
    background: #0f172a;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0 1rem;
    height: 48px;
    line-height: 48px;
    border-radius: 8px;
    outline: none;
    font-size: 0.95rem;
    flex: 1;
    min-width: 160px; /* Smaller min-width to fit rows better */
    max-width: 300px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rt-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

/* --- TINKLELIS (GRID) --- */
.rt-grid {
    display: grid;
    /* 320px leidžia sutalpinti 3 korteles ir ant mažesnių laptopų */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important; 
    gap: 1.5rem !important;
}

/* --- KORTELĖ --- */
.rt-card {
    background: var(--card);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-elevation);
}

.rt-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent);
}

/* --- IMAGE SECTION --- */
.rt-image-wrap {
    height: 200px;
    position: relative;
    overflow: hidden;
}

.rt-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.rt-card:hover .rt-image-wrap img {
    transform: scale(1.1);
    filter: brightness(1.1);
}

.rt-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.6) 100%);
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

/* --- BADGES --- */
.rt-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(139, 92, 246, 0.9);
    backdrop-filter: blur(4px);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: white;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.rt-date-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(4px);
    border-radius: 10px;
    padding: 6px 10px;
    text-align: center;
    color: white;
    z-index: 2;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    min-width: 50px;
}

.rt-date-day {
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1;
    color: var(--accent);
}

.rt-date-month {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* --- CONTENT --- */
.rt-content {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rt-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-main);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rt-subtitle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* --- PRICE SECTION --- */
.rt-price-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.rt-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
}
.rt-price.free { color: var(--success); }

.rt-action-btn {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}
.rt-action-btn:hover {
    background: var(--accent);
    color: white;
}

/* --- RESPONSIVE FIXES --- */
@media (max-width: 1024px) {
    .rt-filters-container {
        flex-direction: column;
        align-items: stretch;
    }
    .rt-search-row {
        width: 100%;
        justify-content: space-between;
    }
    .rt-input {
        max-width: 100%;
        min-width: 0;
    }
}

@media (max-width: 600px) {
    #rt-app { padding: 1rem 0; }
    
    /* Header Stack */
    .rt-tabs { 
        justify-content: flex-start;
        overflow-x: auto; 
        padding-bottom: 5px;
        width: 100%;
        flex-wrap: nowrap; /* Horiz scroll for tabs on very small screens */
    }
    
    .rt-search-row {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .rt-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 1rem;
        padding: 0 10px; /* Safe padding */
    }
    
    /* Prevent overflow */
    .rt-card { margin: 0; width: 100%; }
}
