/* Pinterest Downloader Styles */

/* Media Grid for Multiple Items */
.pinterest-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Media Card */ 
.pinterest-media-card {  
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.pinterest-media-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    border-color: #e60023;
}

/* Media Preview Container */
.pinterest-preview-wrapper {
    position: relative;
    width: 100%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pinterest-preview-wrapper img,
.pinterest-preview-wrapper video {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Quality Badge */
.quality-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(230, 0, 35, 0.95);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(8px);
    z-index: 10;
}

/* Media Info Section */
.pinterest-media-info {
    padding: 16px;
}

.pinterest-media-info .media-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1d23;
    margin-bottom: 8px;
}

.pinterest-media-info .media-details {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 12px;
}

.pinterest-media-info .media-details span {
    display: block;
    margin-bottom: 4px;
}

/* Action Buttons */
.pinterest-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-top: 1px solid #e5e7eb;
}

.pinterest-btn-download {
    flex: 1;
    background: #e60023;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pinterest-btn-download:hover {
    background: #c8001a;
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(230, 0, 35, 0.3);
}

.pinterest-btn-download:active {
    transform: scale(0.98);
}

.pinterest-btn-copy {
    background: white;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pinterest-btn-copy:hover {
    background: #f8f9fa;
    border-color: #cbd5e1;
    color: #374151;
}

/* Pin Info Card Styling */
#pinTitle {
    font-size: 20px;
    font-weight: 700;
    color: var(--bs-primary-text-emphasis);
    margin-bottom: 16px;
    line-height: 1.4;
}

.pin-meta-info {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 12px;
}

.pin-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6b7280;
}

.pin-meta-item strong {
    color: #374151;
}

.pin-meta-item a {
    color: #e60023;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.pin-meta-item a:hover {
    color: #c8001a;
    text-decoration: underline;
}

/* Loading State */
.pinterest-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 12px;
}

.pinterest-loading .spinner-border {
    color: #e60023;
}

/* Empty State */
.pinterest-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.pinterest-empty img {
    width: 120px;
    height: 120px;
    opacity: 0.5;
    margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pinterest-media-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .pinterest-actions {
        flex-direction: column;
    }

    .pinterest-btn-download,
    .pinterest-btn-copy {
        width: 100%;
    }

    #pinTitle {
        font-size: 18px;
    }

    .pin-meta-info {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 576px) {
    .pinterest-media-card {
        border-radius: 8px;
    }

    .pinterest-media-info {
        padding: 12px;
    }

    .pinterest-actions {
        padding: 10px 12px;
    }

    .quality-badge {
        top: 8px;
        right: 8px;
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* Dark Mode */
[data-bs-theme="dark"] .pinterest-media-card {
    background: #1a1d23;
    border-color: #343a40;
}

[data-bs-theme="dark"] .pinterest-media-card:hover {
    border-color: #e60023;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .pinterest-preview-wrapper {
    background: #2d3239;
}

[data-bs-theme="dark"] .pinterest-media-info .media-title {
    color: #f8f9fa;
}

[data-bs-theme="dark"] .pinterest-media-info .media-details {
    color: #9ca3af;
}

[data-bs-theme="dark"] .pinterest-actions {
    background: #2d3239;
    border-top-color: #343a40;
}

[data-bs-theme="dark"] .pinterest-btn-copy {
    background: #343a40;
    border-color: #495057;
    color: #9ca3af;
}

[data-bs-theme="dark"] .pinterest-btn-copy:hover {
    background: #3a3f47;
    border-color: #5a6269;
    color: #f8f9fa;
}

[data-bs-theme="dark"] .pin-meta-item {
    color: #9ca3af;
}

[data-bs-theme="dark"] .pin-meta-item strong {
    color: #e5e7eb;
}

[data-bs-theme="dark"] .pinterest-loading {
    background: #2d3239;
}

[data-bs-theme="dark"] .pinterest-empty {
    color: #9ca3af;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#mediaContainer[style*="display: block"] {
    animation: fadeIn 0.4s ease;
}

.pinterest-media-card {
    animation: fadeIn 0.3s ease;
}

/* Download Progress Overlay */
.download-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.download-progress {
    background: white;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .download-progress {
    background: #1a1d23;
    color: white;
}

.download-progress .spinner-border {
    color: #e60023;
    width: 3rem;
    height: 3rem;
    margin-bottom: 16px;
}

.download-progress p {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
}

[data-bs-theme="dark"] .download-progress p {
    color: #f8f9fa;
}
