/* Download Media Facebook page */
:root {
    --primary-color: #8105BD;
    --primary-hover: #6a039b;
    --secondary-color: #f0f2f5;
    --text-color: #1a1a1a;
    --text-light: #65676b;
    --white: #ffffff;
    --linear-color: linear-gradient(90deg, #CF07E2 0%, #8105BD 100%);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --radius-lg: 16px;
    --radius-xl: 24px;
}

body {
    background-color: #f8f9fa;
    /* Light background for the whole page */
}

.dm-page {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
    font-family: 'Inter', sans-serif;
    /* Assumes Inter or system font */
}

/* Header Section */
.dm-header {
    text-align: center;
    margin-bottom: 48px;
}

.dm-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 24px;
    transition: color 0.2s;
}

.dm-back-link:hover {
    color: var(--primary-color);
}

.dm-title {
    font-size: 48px;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 16px;
    line-height: 1.2;
}

.dm-title .highlight {
    background: var(--linear-color);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.dm-subtitle {
    font-size: 18px;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Search Section */
.dm-search-container {
    background: var(--white);
    padding: 32px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    margin-bottom: 48px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.dm-search-box {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    /* Handle mobile */
}

.dm-input-group {
    flex: 1;
    position: relative;
    min-width: 300px;
}

.dm-input {
    width: 100%;
    height: 56px;
    padding: 0 20px 0 52px;
    /* Space for icon */
    border: 2px solid #e4e6eb;
    border-radius: var(--radius-lg);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dm-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(129, 5, 189, 0.1);
}

.dm-search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-light);
    pointer-events: none;
}

.dm-btn-primary {
    height: 56px;
    padding: 0 32px;
    background: var(--linear-color);
    color: var(--white);
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.dm-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(129, 5, 189, 0.3);
}

.dm-btn-primary:active {
    transform: translateY(0);
}

.dm-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Info Cards */
.dm-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.dm-feature-card {
    background: var(--white);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: transform 0.2s;
}

.dm-feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.dm-feature-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(129, 5, 189, 0.05);
    border-radius: 50%;
    color: var(--primary-color);
}

.dm-feature-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-color);
}

.dm-feature-desc {
    color: var(--text-light);
    line-height: 1.6;
}

/* Results Area */
.dm-result-area {
    margin-top: 32px;
    animation: fadeIn 0.4s ease-out;
}

.dm-media-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    /* Mobile first */
}

@media (min-width: 768px) {
    .dm-media-card {
        flex-direction: row;
        align-items: flex-start;
    }
}

.dm-media-preview {
    flex: 1;
    background: #000;
    position: relative;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dm-media-preview video,
.dm-media-preview img {
    max-width: 100%;
    max-height: 500px;
    width: auto;
    height: auto;
}

.dm-media-details {
    flex: 1;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dm-media-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dm-media-meta {
    display: flex;
    gap: 16px;
    color: var(--text-light);
    font-size: 14px;
    flex-wrap: wrap;
}

.dm-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dm-downloads {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dm-download-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #f0f2f5;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: background 0.2s;
}

.dm-download-btn:hover {
    background: #e4e6eb;
}

.dm-download-btn.primary {
    background: var(--linear-color);
    color: var(--white);
}

.dm-download-btn.primary:hover {
    opacity: 0.9;
}

/* Error State */
.dm-error-box {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: #991b1b;
    padding: 16px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 0.8s linear infinite;
}