/* Import base styles from home.css */
@import url('home.css');

/* Random Page Specific Styles */

/* Random Header Styles */
.random-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 40px 0 30px;
    padding: 30px;
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    border: 1px solid #ff2c2c30;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.random-title h1 {
    font-size: 2.5rem;
    margin: 0 0 10px 0;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 15px;
}

.random-title h1 i {
    color: #ff2c2c;
    font-size: 2.2rem;
}

.random-title p {
    color: #ccc;
    font-size: 1.1rem;
    margin: 0;
    line-height: 1.5;
}

.random-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: flex-end;
}

.random-btn {
    background: linear-gradient(135deg, #ff2c2c 0%, #d42424 50%, #801515 100%);
    border: none;
    border-radius: 50px;
    padding: 15px 30px;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(255, 44, 44, 0.3);
    animation: randomPulse 2s infinite;
}

@keyframes randomPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(255, 44, 44, 0.3);
    }
    50% {
        box-shadow: 0 6px 25px rgba(255, 44, 44, 0.5);
    }
}

.random-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 44, 44, 0.4);
}

.random-btn:active {
    transform: translateY(0);
}

.random-btn i {
    font-size: 18px;
}

.random-filters {
    display: flex;
    gap: 10px;
    align-items: center;
}

.random-filters .filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 44, 44, 0.1);
    border: 1px solid #ff2c2c;
    border-radius: 20px;
    color: #ff2c2c;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
    outline: none;
}

.random-filters .filter-btn:hover {
    background: rgba(255, 44, 44, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(255, 44, 44, 0.2);
}

.random-filters .filter-btn.active {
    background: #ff2c2c;
    color: #fff;
    box-shadow: 0 3px 10px rgba(255, 44, 44, 0.3);
}

.random-filters .filter-btn.active:hover {
    background: #e02424;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(255, 44, 44, 0.4);
}

.random-filters .filter-btn i {
    font-size: 12px;
}

/* Roulette Section */
.roulette-section {
    margin: 40px 0;
}

.roulette-options {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

.roulette-btn {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 2px solid #ff2c2c30;
    border-radius: 20px;
    padding: 25px 30px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    position: relative;
    overflow: hidden;
}

.roulette-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff2c2c, #801515, #ff2c2c);
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}

.roulette-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(255, 44, 44, 0.3);
    border-color: #ff2c2c;
}

.roulette-btn i {
    font-size: 32px;
    margin-bottom: 5px;
}

.roulette-emoji {
    font-size: 48px;
    line-height: 1;
}

.roulette-text {
    font-size: 18px;
    font-weight: 700;
    text-align: center;
}

.roulette-subtitle {
    font-size: 14px;
    color: #ccc;
    text-align: center;
    line-height: 1.3;
}

.cry-btn:hover {
    border-color: #4a90e2;
    box-shadow: 0 15px 40px rgba(74, 144, 226, 0.3);
}

.cry-btn::before {
    background: linear-gradient(90deg, #4a90e2, #2c5aa0, #4a90e2);
}

.laugh-btn:hover {
    border-color: #f39c12;
    box-shadow: 0 15px 40px rgba(243, 156, 18, 0.3);
}

.laugh-btn::before {
    background: linear-gradient(90deg, #f39c12, #e67e22, #f39c12);
}

/* Random Content Display */
.random-content {
    margin: 30px 0;
    min-height: 400px;
}

.random-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    border: 1px solid #ff2c2c30;
    border-radius: 16px;
    color: #ccc;
}

.random-placeholder i {
    font-size: 64px;
    color: #ff2c2c;
    margin-bottom: 20px;
    opacity: 0.7;
}

.random-placeholder h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #fff;
}

.random-placeholder p {
    font-size: 16px;
    margin: 0;
    line-height: 1.5;
}

/* Ensure main content has minimum height to push disclaimer down */
main.container {
    min-height: calc(100vh - 200px); /* Account for header and footer space */
}

/* Random Content Display - Center single card */
.random-content {
    margin: 30px 0;
    min-height: 0;
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 5px;
    scrollbar-width: thin;
    scrollbar-color: #ff2c2c #1a1a1a;
}

/* Show random content when it has content */
.random-content.has-content {
    display: flex;
    min-height: 400px;
}

.random-content::-webkit-scrollbar {
    height: 8px;
}

.random-content::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 10px;
}

.random-content::-webkit-scrollbar-thumb {
    background: #ff2c2c;
    border-radius: 10px;
}

/* Hide random content when empty */
.random-content:empty {
    display: none;
}

/* Random Content Card - Like homepage content cards */
.random-card {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
    height: auto;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s;
    flex-shrink: 0;
    flex-grow: 0;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    cursor: pointer;
}

.random-card:hover {
    transform: scale(1.05);
    z-index: 10;
}

.random-card img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
    background: #2a2a2a;
}

.random-card-overlay {
    position: relative;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.95));
    padding: 15px;
    opacity: 1;
    transition: opacity 0.3s;
    margin-top: -5px;
    height: 80px;
    overflow: hidden;
}

.random-card-title {
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    line-height: 1.2;
    color: #fff;
}

.random-card-info {
    display: flex;
    gap: 10px;
    font-size: 0.8rem;
    opacity: 0.8;
    margin-bottom: 0;
    align-items: center;
    flex-wrap: wrap;
}

.random-card-info span {
    display: flex;
    align-items: center;
    gap: 2px;
    color: #ccc;
}

/* Star rating styling */
.rating-span {
    color: #ffd700 !important;
    font-weight: 600;
}

/* Content type styling */
.content-type {
    font-weight: 600;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.movie-type {
    color: #ff4757;
    background: rgba(255, 71, 87, 0.1);
}

.tv-type {
    color: #3742fa;
    background: rgba(55, 66, 250, 0.1);
}

/* Genre Grid */
.genre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.genre-card {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 1px solid #ff2c2c30;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.genre-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff2c2c, #801515, #ff2c2c);
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}

.genre-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(255, 44, 44, 0.2);
    border-color: #ff2c2c;
}

.genre-card i {
    font-size: 32px;
    color: #ff2c2c;
    margin-bottom: 12px;
    display: block;
}

.genre-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #fff;
}

.genre-card p {
    font-size: 14px;
    color: #ccc;
    margin: 0;
    line-height: 1.4;
}


/* Loading Animation for Random Content */
.random-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #ff2c2c;
}

.random-loading i {
    font-size: 40px;
    margin-bottom: 20px;
    animation: spin 1s linear infinite;
}

.random-loading p {
    font-size: 16px;
    color: #aaa;
    margin: 0;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Adjust main height for mobile bottom navigation */
    main.container {
        min-height: calc(100vh - 280px); /* Account for header, bottom nav, and footer */
    }
    
    .random-header {
        flex-direction: column;
        gap: 20px;
        align-items: stretch;
        margin: 20px 0;
        padding: 20px;
    }
    
    .roulette-options {
        flex-direction: row;
        gap: 15px;
        align-items: center;
        justify-content: center;
    }
    
    .roulette-btn {
        min-width: 180px;
        padding: 20px 25px;
    }
    
    .roulette-btn i {
        font-size: 28px;
    }
    
    .roulette-emoji {
        font-size: 40px;
    }
    
    .roulette-text {
        font-size: 16px;
    }
    
    .roulette-subtitle {
        font-size: 13px;
    }
    
    .random-title h1 {
        font-size: 2rem;
        text-align: center;
    }
    
    .random-title h1 i {
        font-size: 1.8rem;
    }
    
    .random-title p {
        font-size: 1rem;
        text-align: center;
    }
    
    .random-controls {
        align-items: center;
        gap: 15px;
    }
    
    .random-btn {
        padding: 12px 24px;
        font-size: 14px;
        width: 100%;
        max-width: 200px;
    }
    
    .random-filters {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .random-filters .filter-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .random-placeholder {
        padding: 60px 15px;
    }
    
    .random-placeholder i {
        font-size: 48px;
    }
    
    .random-placeholder h3 {
        font-size: 24px;
    }
    
    .random-placeholder p {
        font-size: 14px;
    }
    
    .random-content {
        gap: 15px;
        overflow-x: auto;
        padding: 10px 5px;
        -webkit-overflow-scrolling: touch;
    }
    
    .random-card {
        width: 130px;
        min-width: 130px;
        max-width: 130px;
        height: auto;
        flex-grow: 0;
    }
    
    .random-card img {
        height: 200px;
    }
    
    .random-card-overlay {
        padding: 12px;
        opacity: 1;
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.95));
        transition: opacity 0.3s ease;
        height: 85px;
        margin-top: -5px;
        overflow: hidden;
    }
    
    .random-card-title {
        font-size: 14px;
        margin-bottom: 5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.2;
        color: #fff;
    }
    
    .random-card-info {
        font-size: 12px;
        margin-bottom: 0;
        opacity: 0.8;
        line-height: 1.3;
    }
    
    .genre-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .genre-card {
        padding: 15px;
    }
    
    .genre-card i {
        font-size: 28px;
    }
    
    .genre-card h3 {
        font-size: 16px;
    }
    
    .genre-card p {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .random-header {
        margin: 15px 0;
        padding: 15px;
    }
    
    .roulette-btn {
        min-width: 160px;
        padding: 18px 20px;
    }
    
    .roulette-btn i {
        font-size: 24px;
    }
    
    .roulette-emoji {
        font-size: 36px;
    }
    
    .roulette-text {
        font-size: 14px;
    }
    
    .roulette-subtitle {
        font-size: 12px;
    }
    
    .random-title h1 {
        font-size: 1.8rem;
    }
    
    .random-title h1 i {
        font-size: 1.6rem;
    }
    
    .random-title p {
        font-size: 0.9rem;
    }
    
    .random-btn {
        padding: 10px 20px;
        font-size: 13px;
        max-width: 180px;
    }
    
    .random-filters .filter-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .random-placeholder {
        padding: 40px 10px;
    }
    
    .random-placeholder i {
        font-size: 40px;
    }
    
    .random-placeholder h3 {
        font-size: 20px;
    }
    
    .random-placeholder p {
        font-size: 13px;
    }
    
    .random-content {
        gap: 12px;
        overflow-x: auto;
        padding: 10px 5px;
        -webkit-overflow-scrolling: touch;
    }
    
    .random-card {
        width: 110px;
        min-width: 110px;
        max-width: 110px;
        height: auto;
        flex-grow: 0;
    }
    
    .random-card img {
        height: 160px;
    }
    
    .random-card-overlay {
        padding: 10px;
        opacity: 1;
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.95));
        height: 75px;
        margin-top: -5px;
        overflow: hidden;
    }
    
    .random-card-title {
        font-size: 12px;
        margin-bottom: 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.2;
        color: #fff;
    }
    
    .random-card-info {
        font-size: 11px;
        margin-bottom: 0;
        opacity: 0.8;
        line-height: 1.3;
    }
    
    .genre-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 12px;
    }
    
    .genre-card {
        padding: 12px;
    }
    
    .genre-card i {
        font-size: 24px;
    }
    
    .genre-card h3 {
        font-size: 14px;
    }
    
    .genre-card p {
        font-size: 12px;
    }
}

@media (max-width: 360px) {
    .random-content {
        gap: 8px;
    }
    
    .random-card {
        width: 95px;
        min-width: 95px;
        max-width: 95px;
        height: auto;
        flex-grow: 0;
    }
    
    .random-card img {
        height: 140px;
    }
    
    .random-card-overlay {
        padding: 8px;
        opacity: 1;
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.95));
        height: 65px;
        margin-top: -5px;
        overflow: hidden;
    }
    
    .random-card-title {
        font-size: 11px;
        margin-bottom: 3px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.2;
        color: #fff;
    }
    
    .random-card-info {
        font-size: 10px;
        margin-bottom: 0;
        opacity: 0.8;
        line-height: 1.3;
    }
    
    .genre-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .genre-card {
        padding: 10px;
    }
    
    .genre-card i {
        font-size: 20px;
    }
    
    .genre-card h3 {
        font-size: 12px;
    }
    
    .genre-card p {
        font-size: 10px;
    }
}

/* Touch-friendly improvements for mobile */
@media (hover: none) and (pointer: coarse) {
    .random-card:hover {
        transform: none;
    }
    
    .random-card:hover .random-card-image img {
        transform: none;
    }
    
    .random-card:hover .random-card-overlay {
        opacity: 1;
    }
    
    .genre-card:hover {
        transform: none;
    }
    
    .random-btn:hover {
        transform: none;
    }
    
    .random-filters .filter-btn:hover {
        transform: none;
    }
    
    .roulette-btn:hover {
        transform: none;
    }
    
    /* Add active states for touch devices */
    .random-card:active {
        transform: scale(0.98);
    }
    
    .genre-card:active {
        transform: scale(0.98);
    }
    
    .random-btn:active {
        transform: scale(0.95);
    }
    
    .random-filters .filter-btn:active {
        transform: scale(0.95);
    }
    
    .roulette-btn:active {
        transform: scale(0.95);
    }
}

/* High DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .random-card-image img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Performance optimizations for mobile */
@media (max-width: 768px) {
    .random-card {
        will-change: transform;
    }
    
    .random-card-image img {
        will-change: transform;
    }
    
    .genre-card {
        will-change: transform;
    }
    
    /* Reduce animations on mobile for better performance */
    .random-card {
        transition: transform 0.2s ease;
    }
    
    .random-card-image img {
        transition: transform 0.2s ease;
    }
    
    .genre-card {
        transition: transform 0.2s ease;
    }
}
