/* Custom styles for ClipRip Video Downloader */

/* Core body styling */
body {
    padding: 0;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Main search container styling */
.main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 85vh;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

.search-container {
    width: 100%;
    max-width: 700px;
    padding: 2rem;
    background-color: rgba(30, 30, 30, 0.6);
    border-radius: 24px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
}

/* Mobile adjustments */
@media (max-width: 576px) {
    .search-container {
        padding: 1.25rem;
    }
    
    .app-logo h1 {
        font-size: 2.2rem;
    }
    
    .logo-icon {
        font-size: 1.8rem;
    }
    
    .url-input {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .platforms-supported {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .auth-toggle {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }
    
    .auth-panel {
        padding: 1rem;
    }
}

.app-logo {
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.app-logo h1 {
    margin: 0;
    font-size: 2.8rem;
    font-weight: 700;
    background: linear-gradient(90deg, #4f46e5, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0px 2px 8px rgba(79, 70, 229, 0.3);
}

.logo-icon {
    font-size: 2.2rem;
    margin-right: 0.3rem;
    color: #4f46e5;
    font-weight: 700;
    background: linear-gradient(90deg, #4f46e5, #2563eb);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.logo-icon {
    font-size: 2rem;
    margin-right: 0.75rem;
    color: #4f46e5;
}

.search-form {
    width: 100%;
}

.url-input-container {
    display: flex;
    width: 100%;
    position: relative;
    margin-bottom: 1rem;
}

.url-input {
    flex: 1;
    background-color: rgba(15, 23, 42, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 1.25rem 1.5rem;
    padding-right: 60px; /* Extra space for the button */
    font-size: 1.1rem;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(4px);
}

.url-input:focus {
    outline: none;
    border-color: rgba(79, 70, 229, 0.6);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3), 0 4px 12px rgba(0, 0, 0, 0.1);
    background-color: rgba(15, 23, 42, 0.8);
}

.url-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.05rem;
}

.grab-button {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
    z-index: 5; /* Ensure button is above input */
}

.grab-button:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.6);
    background: linear-gradient(135deg, #4338ca, #4f46e5);
}

.grab-button i {
    font-size: 1.2rem;
}

/* Fix for mobile devices */
@media (max-width: 576px) {
    .url-input {
        padding-right: 55px; /* More space for the button on mobile */
        font-size: 1rem;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    .grab-button {
        width: 42px;
        height: 42px;
    }
    
    .grab-button i {
        font-size: 1rem;
    }
    
    .url-input::placeholder {
        font-size: 0.9rem;
    }
}

.platforms-supported {
    display: flex;
    justify-content: center;
    gap: 1.8rem;
    margin-bottom: 1.5rem;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.platforms-supported:hover {
    opacity: 1;
}

.platform {
    display: inline-flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    padding: 0.4rem 0.8rem;
    border-radius: 30px;
    background: rgba(30, 41, 59, 0.4);
    transition: all 0.3s ease;
}

.platform:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.platform i {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.platform.youtube {
    border-left: 3px solid #ff0000;
}

.platform.youtube i {
    color: #ff0000;
}

.platform.twitter {
    border-left: 3px solid #1da1f2;
}

.platform.twitter i {
    color: #1da1f2;
}

.platform.rumble {
    border-left: 3px solid #85c742;
}

.platform.rumble i {
    color: #85c742;
}

.platform.bitchute {
    border-left: 3px solid #ff6b35;
}

.platform.bitchute i {
    color: #ff6b35;
}

.platform.brighteon {
    border-left: 3px solid #f59e0b;
}

.platform.brighteon i {
    color: #f59e0b;
}

/* Extraction status styling */
.extraction-status {
    margin-top: 1rem;
    padding: 1rem;
    background-color: rgba(15, 23, 42, 0.4);
    border-radius: 16px;
    border: 1px solid rgba(79, 70, 229, 0.3);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-in-out;
}

.extraction-status .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 0.95rem;
}

.extraction-status .spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

.auth-option {
    margin-top: 1.5rem;
}

.auth-toggle {
    background-color: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.auth-toggle:hover {
    background-color: rgba(79, 70, 229, 0.2);
    color: rgba(255, 255, 255, 1);
    border-color: rgba(79, 70, 229, 0.3);
    transform: translateY(-2px);
}

.auth-panel {
    margin-top: 1rem;
    padding: 1.5rem;
    background-color: rgba(15, 23, 42, 0.4);
    border-radius: 16px;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
}

.auth-info {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.cookie-input {
    width: 100%;
    background-color: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    font-size: 0.9rem;
    color: white;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    resize: vertical;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.cookie-input:focus {
    outline: none;
    border-color: rgba(79, 70, 229, 0.5);
}

.save-cookies-btn {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    font-weight: 500;
}

.save-cookies-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(79, 70, 229, 0.5);
    background: linear-gradient(135deg, #4338ca, #4f46e5);
}

/* Description Read More functionality */
.description-box {
    background-color: rgba(15, 23, 42, 0.4);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.description-content {
    position: relative;
}

.description-text {
    max-height: 125px; /* Approximately 5 lines of text */
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.description-text.expanded {
    max-height: 2000px; /* Large enough to show all content */
}

.read-more-container {
    text-align: center;
    margin-top: 8px;
    position: relative;
}

.read-more-container:before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 100%;
    height: 30px;
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0), rgba(15, 23, 42, 0.8));
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.description-text.expanded + .read-more-container:before {
    opacity: 0;
}

.read-more-btn {
    background-color: rgba(79, 70, 229, 0.2);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(79, 70, 229, 0.3);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.read-more-btn:hover {
    background-color: rgba(79, 70, 229, 0.4);
    transform: translateY(-2px);
}

/* Define custom color variables */
:root {
    /* Text colors */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.85);
    --text-muted: rgba(255, 255, 255, 0.7);
    
    /* Background colors */
    --bg-dark: #121212;
    --bg-card: #1e1e1e;
    --bg-hover: #2d2d2d;
    --border-subtle: rgba(255, 255, 255, 0.1);
    
    /* Brand colors */
    --primary-color: #4f46e5; /* Indigo */
    --primary-hover: #4338ca;
    --primary-light: rgba(79, 70, 229, 0.15);
    --success-color: #10b981; /* Emerald */
    --success-hover: #059669;
    --danger-color: #ef4444; /* Red */
    --warning-color: #f59e0b; /* Amber */
    --info-color: #3b82f6; /* Blue */
}

/* Flash message styling */
.flash-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 90%;
    max-width: 500px;
}

.flash-message {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(30, 30, 30, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-left: 5px solid rgba(255, 255, 255, 0.3);
    animation: slideDown 0.3s ease-out forwards;
}

.flash-success {
    border-left-color: #10b981;
}

.flash-danger, .flash-error {
    border-left-color: #ef4444;
}

.flash-warning {
    border-left-color: #f59e0b;
}

.flash-info {
    border-left-color: #3b82f6;
}

.flash-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.flash-close:hover {
    color: white;
}

.flash-closing {
    animation: slideUp 0.3s ease-out forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Main container with shadow */
.container {
    background-color: transparent;
}

/* Navbar styling - simplified */
.navbar {
    background: transparent !important;
    box-shadow: none;
    padding: 1rem 0;
}

.navbar-brand {
    font-size: 1.2rem;
    letter-spacing: 0.5px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Improve card styling */
.card {
    border: none;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
    background-color: var(--bg-card);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    border: 1px solid var(--border-subtle);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.25);
}

.card-header {
    font-weight: 600;
    border-bottom: none;
    padding: 1.25rem 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    color: white;
}

.card-body {
    padding: 1.5rem;
    color: var(--text-primary);
}

/* Card header colors with improved contrast */
.card-header.bg-primary {
    background: linear-gradient(90deg, #1a73e8, #0d47a1) !important;
}

.card-header.bg-success {
    background: linear-gradient(90deg, #2e7d32, #1b5e20) !important;
}

.card-header.bg-info {
    background: linear-gradient(90deg, #0288d1, #01579b) !important;
}

.card-header.bg-secondary {
    background: linear-gradient(90deg, #455a64, #263238) !important;
}

/* Improve form styling */
.form-control {
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease-in-out;
    border: 1px solid var(--border-subtle);
    background-color: #1a1d21;
    color: white;
}

.form-control:focus {
    border-color: #2684ff;
    box-shadow: 0 0 0 0.25rem rgba(38, 132, 255, 0.25);
    background-color: #1e2125;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.input-group {
    border-radius: 0.5rem;
    overflow: hidden;
}

.input-group-text {
    background-color: #1a73e8;
    color: white;
    border: none;
    padding-left: 1rem;
    padding-right: 1rem;
    font-weight: 500;
}

/* Button styling */
.btn {
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: none;
}

.btn-primary {
    background: linear-gradient(90deg, #2684ff, #0d5bdd);
    color: white;
}

.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(90deg, #0d5bdd, #2684ff);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(38, 132, 255, 0.4);
    color: white;
}

.btn-success {
    background: linear-gradient(90deg, #28a745, #1e7e34);
    color: white;
}

.btn-success:hover, .btn-success:focus {
    background: linear-gradient(90deg, #1e7e34, #28a745);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.4);
    color: white;
}

.btn-secondary {
    background: linear-gradient(90deg, #495057, #343a40);
    color: white;
}

.btn-secondary:hover, .btn-secondary:focus {
    background: linear-gradient(90deg, #343a40, #495057);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(73, 80, 87, 0.4);
    color: white;
}

/* Custom styling for code blocks */
pre {
    border-radius: 0.5rem;
    background-color: #212529;
    color: #f8f9fa;
    padding: 1rem;
    font-size: 0.875rem;
    overflow-x: auto;
}

/* Add hover effect to list items */
.list-group-item {
    transition: background-color 0.15s ease-in-out;
}

.list-group-item:hover {
    background-color: var(--bs-dark-bg-subtle);
}

/* Style for the thumbnail in results page */
.img-fluid.rounded {
    max-height: 240px;
    object-fit: cover;
    width: 100%;
}

/* Add hover effect to download buttons */
.btn-success {
    transition: all 0.2s ease;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Base layout adjustments */
    .card-body {
        padding: 1rem;
    }
    
    h3, h4 {
        font-size: 1.3rem;
    }
    
    .lead {
        font-size: 1rem;
    }
    
    /* Form elements adjustments for mobile */
    .form-control {
        font-size: 16px; /* Prevents iOS zoom on input focus */
        padding: 0.6rem 0.75rem;
    }
    
    /* Mobile-friendly button size */
    .btn {
        padding: 0.6rem 1rem;
        white-space: normal; /* Allow text wrapping */
    }
    
    /* Improved table for mobile viewing */
    .table th, .table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }
    
    /* Make cards take less vertical space */
    .card {
        margin-bottom: 1rem;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
    }
    
    /* Better responsive images */
    .img-fluid.rounded {
        max-height: 180px;
    }
    
    /* Adjusted spacing for list groups */
    .list-group-item {
        padding: 0.75rem;
    }
    
    /* Format download buttons for easier mobile tapping */
    .btn-sm {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    /* Ensure navbar items are properly sized */
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    /* Improve spacing in the footer */
    .footer {
        padding: 1.5rem 0;
    }
    
    /* Ensure tables are scrollable on mobile */
    .table-responsive {
        overflow-x: auto;
        border-radius: 0.5rem;
    }
}

/* Progress bar custom styling */
.progress {
    height: 0.5rem;
    background-color: var(--bs-dark-bg-subtle);
}

.progress-bar {
    background-color: var(--bs-primary);
}

/* Add some subtle animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.card {
    animation: fadeIn 0.5s ease-in-out;
}

.list-group-item {
    animation: slideIn 0.3s ease-in-out;
    animation-fill-mode: both;
}

.list-group-item:nth-child(1) { animation-delay: 0.1s; }
.list-group-item:nth-child(2) { animation-delay: 0.2s; }
.list-group-item:nth-child(3) { animation-delay: 0.3s; }
.list-group-item:nth-child(4) { animation-delay: 0.4s; }

/* Pulse animation for download button */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.btn-lg {
    animation: pulse 2s infinite;
}

/* Custom styling for download options */
.download-options-container {
    margin-top: 1rem;
}

.download-option-card {
    background-color: #2c3035; /* Darker background for better contrast */
    transition: all 0.2s ease-in-out;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.download-option-card:hover {
    background-color: #373c42; /* Slightly lighter on hover for visual feedback */
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3);
}

.download-option-card h5 {
    font-weight: 600;
    color: white; /* High contrast white text */
    letter-spacing: 0.5px;
}

.download-option-card .text-muted {
    color: rgba(255, 255, 255, 0.7) !important; /* More visible muted text */
}

.download-option-card .download-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

/* Special styling for "Best" option */
.download-option-card:first-child {
    background-color: rgba(38, 132, 255, 0.15); /* Blueish background for best option */
    border: 1px solid rgba(38, 132, 255, 0.3);
}

/* Badge styling */
.badge.bg-secondary {
    background-color: #495057 !important; /* Darker, more visible badge */
    color: white;
    font-weight: 500;
    padding: 0.4em 0.6em;
}

/* Mobile adjustments for download options */
@media (max-width: 576px) {
    .download-option-card {
        padding: 0.75rem !important;
    }
    
    .download-option-card h5 {
        font-size: 1rem;
    }
    
    .download-option-card .btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* For backward compatibility with existing tables */
.table {
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

.table tr {
    background-color: var(--bs-dark-bg-subtle);
    transition: all 0.2s;
    border-radius: 0.5rem;
}

.table th, .table td {
    vertical-align: middle;
    padding: 1rem;
    border: none;
}
