/* SnapVideo WordPress Plugin Styles */

:root {
    --primary-color: #fe2c55;
    --secondary-color: #25f4ee;
    --facebook-color: #1877f2;
    --instagram-color: #E4405F;
    --dark-bg: #121212;
    --light-bg: #ffffff;
    --text-dark: #161823;
    --text-light: #8a8a8a;
    --border-color: #e1e8ed;
    --success-color: #00d26a;
    --error-color: #ff6b6b;
}

#snapvideo-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Platform Tabs */
.platform-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.platform-tab {
    flex: 1;
    max-width: 200px;
    padding: 15px 30px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.platform-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.platform-tab.active[data-platform="facebook"] {
    background: var(--facebook-color);
}

.platform-tab.active[data-platform="tiktok"] {
    background: var(--primary-color);
}

.platform-tab.active[data-platform="instagram"] {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

/* Quality Selector */
.quality-selector {
    display: none;
    margin-bottom: 15px;
}

.quality-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.quality-selector select {
    width: 100%;
    height: 50%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.quality-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Video Meta Info */
.video-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 5px 0;
    color: var(--text-light);
    font-size: 14px;
}

.video-meta i {
    color: var(--primary-color);
}

/* History Platform Badge */
.history-platform {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: #f1f3f5;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    text-transform: uppercase;
}

/* Header */
.snapvideo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px 0;
}

.snapvideo-logo h1 {
    font-size: 28px;
    font-weight: bold;
    color: var(--primary-color);
    margin: 0;
}

.snapvideo-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.lang-switcher {
    display: flex;
    gap: 8px;
}

.lang-btn {
    padding: 3px 15px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.lang-btn:hover,
.lang-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s;
}

.icon-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.history-badge {
    width: 50%;
    height: 50%;
    position: absolute;
    top: -8px;
    right: -5px;
    background: var(--primary-color);
    color: white;
    border-radius: 50px;
    /* padding: 2px 4px; */
    font-size: 10px;
    line-height: 16px;
    font-weight: bold;
    display: none;
}

/* Hero Section */
.snapvideo-hero {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    color: white;
    margin-bottom: 30px;
}

.snapvideo-hero h2 {
    font-size: 36px;
    margin: 0 0 15px 0;
    font-weight: 700;
}

.snapvideo-hero p {
    font-size: 18px;
    margin: 0;
    opacity: 0.9;
}

/* Search Form */
.snapvideo-search {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.url-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
}

.url-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(254,44,85,0.1);
}

.btn {
    padding: 3px 15px;
    line-height: 10px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #e01446;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(254,44,85,0.3);
}

.btn-secondary {
    background: #f1f3f5;
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: #e9ecef;
}

.search-info {
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
}

/* Loader */
.snapvideo-loader {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Download Result */
.download-result {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-top: 20px;
}

.download-header {
    text-align: center;
    margin-bottom: 30px;
}

.download-header h2 {
    color: var(--primary-color);
    margin: 0 0 10px 0;
}

.download-header p {
    color: var(--text-light);
    margin: 0;
}

.video-data {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
}

.tik-left {
    flex: 1;
}

.thumbnail {
    text-align: center;
}

.thumbnail img {
    max-width: 100%;
    border-radius: 10px;
    margin-bottom: 15px;
}

.content h3 {
    margin: 0;
    color: var(--text-dark);
    font-size: 18px;
}

.tik-right {
    flex: 1;
}

.dl-action {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tik-button-dl {
    width: 100%;
    padding: 15px 25px;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.tik-button-dl:hover {
    background: #00b85a;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,210,106,0.3);
}

.more-video {
    display: block;
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.more-video:hover {
    background: #e9ecef;
}

/* Error Message */
.error-message {
    background: #ffe0e0;
    border-left: 4px solid var(--error-color);
    padding: 15px 20px;
    border-radius: 10px;
    color: #c92a2a;
    margin-top: 20px;
}

/* History Modal */
.history-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.history-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.history-modal-content {
    position: relative;
    background: white;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    border-radius: 15px;
    padding: 30px;
    overflow-y: auto;
    z-index: 10000;
}

.history-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.history-modal-header h2 {
    margin: 0;
    color: var(--text-dark);
}

.close-history-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
}

.history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 10px;
}

.history-item-info h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: var(--text-dark);
}

.history-item-info p {
    margin: 0;
    font-size: 13px;
    color: var(--text-light);
}

.history-item-actions {
    display: flex;
    gap: 10px;
}

.history-btn-small {
    padding: 8px 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.history-btn-small:hover {
    background: #e01446;
}

.history-btn-delete {
    padding: 8px 15px;
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.history-btn-delete:hover {
    background: #ff5252;
}

.clear-all-history {
    width: 100%;
    padding: 15px;
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    margin-top: 15px;
}

.clear-all-history:hover {
    background: #ff5252;
}

.history-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.history-empty i {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

/* Dark Mode */
body.snapvideo-dark-mode #snapvideo-container {
    background: var(--dark-bg);
    color: white;
}

body.snapvideo-dark-mode .snapvideo-search,
body.snapvideo-dark-mode .download-result,
body.snapvideo-dark-mode .history-modal-content {
    background: #1e1e1e;
    color: white;
}

body.snapvideo-dark-mode .url-input {
    background: #2a2a2a;
    color: white;
    border-color: #3a3a3a;
}

body.snapvideo-dark-mode .btn-secondary {
    background: #2a2a2a;
    color: white;
}

body.snapvideo-dark-mode .lang-btn {
    background: #2a2a2a;
    color: white;
    border-color: #3a3a3a;
}

body.snapvideo-dark-mode .icon-btn {
    background: #2a2a2a;
    color: white;
    border-color: #3a3a3a;
}

body.snapvideo-dark-mode .history-item {
    border-color: #3a3a3a;
    background: #2a2a2a;
}

body.snapvideo-dark-mode .platform-tab {
    background: #2a2a2a;
    color: white;
    border-color: #3a3a3a;
}

body.snapvideo-dark-mode .quality-selector select {
    background: #2a2a2a;
    color: white;
    border-color: #3a3a3a;
}

/* Responsive */
@media (max-width: 768px) {
    .snapvideo-header {
        flex-direction: column;
        gap: 15px;
    }

    .video-data {
        flex-direction: column;
    }

    .search-form {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .history-item {
        flex-direction: column;
        gap: 10px;
    }

    .history-item-actions {
        width: 100%;
        flex-direction: column;
    }

    .history-btn-small,
    .history-btn-delete {
        width: 100%;
    }

    .platform-tabs {
        flex-direction: column;
    }

    .platform-tab {
        max-width: 100%;
    }
}
