/*
Theme Name: SnapInsta
Theme URI: https://example.com/snapinsta
Author: Custom Development
Author URI: https://example.com
Description: Instagram media downloader WordPress theme
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: snapinsta
Tags: instagram, downloader, media, social
*/

/* Basic Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0095f6;
    --secondary-color: #00c16e;
    --text-color: #333;
    --light-text: #777;
    --background-color: #f8f8f8;
    --card-bg: #fff;
    --border-color: #e1e1e1;
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition-speed: 0.3s;
    --button-color: #3F51B5;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: #0056b3;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
.site-header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    position: relative;
    z-index: 10;
}

.site-branding {
    display: flex;
    align-items: center;
}

.site-logo {
    max-height: 50px;
    margin-right: 15px;
}

.site-title {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    margin: 0;
    display: flex;
    flex-direction: column;
}

.site-logo-text {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 28px;
}

.site-description {
    font-size: 14px;
    color: var(--light-text);
    margin: 5px 0 0;
}

/* Navigation */
.main-navigation {
    margin-left: auto;
}

.menu {
    display: flex;
    list-style: none;
}

.menu-item {
    margin-left: 20px;
    position: relative;
}

.menu-item a {
    color: var(--text-color);
    font-weight: 500;
    padding: 5px 0;
    position: relative;
}

.menu-item a:hover {
    color: var(--text-color);
}

.current-menu-item a {
    color: var(--primary-color);
}

.current-menu-item a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #0095f6, #00c16e);
    padding: 60px 0;
    color: white;
    text-align: center;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    margin-bottom: 30px;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 15px;
}

.hero-title {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-description {
    font-size: 1.25rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.cta-button {
    display: inline-block;
    background-color: white;
    color: var(--primary-color);
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
    color: var(--primary-color);
}

/* Search Form */
.search-form {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: var(--box-shadow);
    text-align: center;
}

.form-title {
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: var(--text-color);
}

.input-group {
    display: flex;
    margin-bottom: 15px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}


.input-field-container {
    display: flex;
    flex: 1;
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    overflow: hidden;
}

.input-field {
    flex: 1;
    padding: 15px 85px 15px 20px; /* Added more right padding to make room for the paste/clear button */
    font-size: 1rem;
    border: none;
    outline: none;
    transition: border-color var(--transition-speed);
    width: 100%;
    box-sizing: border-box;
}

.input-field:focus {
    border-color: var(--primary-color);
}

.paste-clear-button {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: none;
    padding: 0 15px;
    font-size: 0.9rem;
    color: #555;
    cursor: pointer;
    transition: background-color 0.2s;
}

.paste-button-content, .clear-button-content {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f8f8;
    border-radius: 4px;
    padding: 5px 10px;
}

.paste-icon, .clear-icon {
    margin-right: 5px;
}

.paste-clear-button:hover .paste-button-content,
.paste-clear-button:hover .clear-button-content {
    background-color: #eee;
}

.hidden {
    display: none;
}


.search-button {
    background-color: var(--button-color);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

.search-button:hover {
    background-color: #0077cc;
}

.form-examples {
    font-size: 0.9rem;
    color: var(--light-text);
    margin-top: 15px;
}

/* Loading Indicator */
.loading-indicator {
    display: none;
    text-align: center;
    margin: 20px 0;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 149, 246, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

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

/* Error Message */
.error-message {
    /* display: none; */
    background-color: #ff4d4d;
    color: white;
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    text-align: center;
}

/* Search Results */
.search-title {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-title h2 {
    font-size: 1.5rem;
    color: var(--text-color);
}

.results-count {
    color: var(--light-text);
    font-size: 0.9rem;
}

.instagram-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.instagram-results-grid.single-result {
    grid-template-columns: 1fr;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.result-item {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.result-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.result-media {
    position: relative;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    overflow: hidden;
}

.result-media img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.result-item:hover .result-media img {
    transform: scale(1.05);
}

.result-type {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    overflow: hidden;
}

.result-type i {
    margin: 0 auto;
    font-size: 12px;
}

.result-fullscreen {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
}

.result-item:hover .result-fullscreen {
    opacity: 1;
}

.result-actions {
    padding: 15px;
    display: flex;
    justify-content: center;
}

.download-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--secondary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    transition: background-color 0.3s;
    width: 100%;
}

.download-button i {
    margin-right: 8px;
}

.download-button:hover {
    background-color: #00a05a;
    color: white;
}

/* Media Viewer Modal */
.media-viewer-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    overflow: hidden;
}

.media-viewer-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 1200px;
    max-height: 80vh;
    background-color: transparent;
}

.media-viewer-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 1010;
}

.media-viewer-media {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-flow: column-reverse;
}

.media-viewer-media img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.media-viewer-media video {
    max-width: 100%;
    max-height: 80vh;
}

.media-viewer-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    padding: 0 20px;
}

.media-viewer-prev,
.media-viewer-next {
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.media-viewer-prev:hover,
.media-viewer-next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* How it works section */
.how-it-works {
    padding: 60px 0;
    background-color: white;
    border-radius: var(--border-radius);
    margin-bottom: 40px;
    box-shadow: var(--box-shadow);
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--text-color);
}

.section-description {
    text-align: center;
    color: var(--light-text);
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.step-card {
    text-align: center;
    padding: 30px 20px;
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.step-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    border-radius: 50%;
    margin: 0 auto 20px;
}

.step-title {
    margin-bottom: 15px;
    font-size: 1.3rem;
    color: var(--text-color);
}

.step-description {
    color: var(--light-text);
    font-size: 0.95rem;
}

/* Features section */
.features-section {
    padding: 60px 0;
    margin-bottom: 40px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background-color: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 1.5rem;
    border-radius: 50%;
    margin-bottom: 20px;
}

.feature-title {
    margin-bottom: 15px;
    font-size: 1.3rem;
    color: var(--text-color);
}

.feature-description {
    color: var(--light-text);
    font-size: 0.95rem;
}

/* FAQ section */
.faq-section {
    padding: 60px 0;
    background-color: white;
    border-radius: var(--border-radius);
    /* margin-bottom: 40px; */
    box-shadow: var(--box-shadow);
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.faq-question {
    background-color: #f5f5f5;
    padding: 15px 20px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.faq-question:hover {
    background-color: #f0f0f0;
}

.faq-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    font-size: 12px;
    transition: transform 0.3s;
}

.faq-answer {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    display: none; /* Ẩn mặc định */
}

.faq-answer p {
    padding: 15px 20px;
    color: var(--light-text);
}

.faq-item.active .faq-toggle {
    transform: rotate(45deg);
}

.faq-item.active .faq-answer {
    padding: 15px 20px;
    max-height: 1000px;
    display: block; /* Hiển thị khi active */
}

/* Footer */
.site-footer {
    background-color: #333;
    color: #fff;
    padding: 40px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.footer-column h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: white;
}

.footer-menu {
    list-style: none;
}

.footer-menu li {
    margin-bottom: 10px;
}

.footer-menu a {
    color: #aaa;
    transition: color 0.3s;
}

.footer-menu a:hover {
    color: white;
}

.copyright {
    margin-top: 40px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #444;
    color: #aaa;
    font-size: 14px;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.no-scroll {
    overflow: hidden;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 4px;
    text-align: center;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #0077cc;
    color: white;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
