/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6c5ce7;
    --primary-dark: #5649c0;
    --secondary: #00cec9;
    --dark: #2d3436;
    --light: #f5f6fa;
    --gray: #636e72;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --border-radius: 12px;
}

body {
    font-family: 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: var(--light);
    overflow-x: hidden;
}

.container {
    width: 95%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

/* ===== HEADER STYLES ===== */
header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.5rem 0;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-form {
    flex: 1;
    min-width: 250px;
    max-width: 600px;
    display: flex;
}

.search-form input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 2px solid var(--primary);
    border-radius: 50px 0 0 50px;
    font-size: 1rem;
    transition: var(--transition);
}

.search-form input:focus {
    outline: none;
    border-color: var(--secondary);
}

.search-form button {
    padding: 0 1.5rem;
    background-color: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 0 50px 50px 0;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.search-form button:hover {
    background-color: var(--primary-dark);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    padding: 0.5rem;
    position: relative;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
    transform: translateX(-50%);
}

.nav-links a:hover::after {
    width: 100%;
}

/* ===== MAIN CONTENT AREA ===== */
main {
    padding: 2rem 0;
}

.hero {
    text-align: center;
    margin: 2rem 0 3rem;
    padding: 1rem;
}

.hero h1 {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.hero p {
    font-size: 1.3rem;
    color: var(--gray);
    max-width: 800px;
    margin: 0 auto;
}

/* ===== GIF GRID STYLES ===== */
.gif-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.gif-item {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
}

.gif-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.gif-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: var(--transition);
}

.gif-item:hover img {
    transform: scale(1.03);
}

.gif-meta {
    padding: 1rem;
}

.gif-title {
    font-weight: 500;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.gif-views {
    font-size: 0.9rem;
    color: var(--gray);
    display: block;
}

/* ===== GIF DETAIL PAGE ===== */
.gif-detail {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin: 2rem auto;
    max-width: 1000px;
}

.gif-container {
    margin: 2rem 0;
    text-align: center;
}

.main-gif {
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Social Share Styles */
.social-share-box {
    background: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 30px 0;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.social-share-box h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.social-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.social-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 50px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.social-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    opacity: 0.9;
}

.social-button i {
    font-size: 18px;
}

.social-button.fb { background-color: #3b5998; }
.social-button.tw { background-color: #1DA1F2; }
.social-button.wa { background-color: #25D366; }
.social-button.pt { background-color: #E60023; }
.social-button.copy-link { 
    background-color: var(--primary); 
    cursor: pointer;
}

/* GIF Meta Info */
.gif-meta {
    background: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 25px 0;
}

.gif-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.gif-views {
    font-size: 0.95rem;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 5px;
}

.gif-info p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Related GIFs */
.related-gifs {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

#load-more-related {
    display: block;
    margin: 25px auto 0;
    padding: 12px 30px;
}

/* ===== FOOTER STYLES ===== */
footer {
    background-color: var(--dark);
    color: var(--white);
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--secondary);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.8rem;
}

.footer-section ul li a {
    color: #ddd;
    text-decoration: none;
    transition: var(--transition);
    display: inline-block;
}

.footer-section ul li a:hover {
    color: var(--secondary);
    transform: translateX(5px);
}

.copyright {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .search-form {
        width: 100%;
        margin: 0;
    }
    
    .nav-links {
        justify-content: center;
    }
    
    .gif-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .gif-item img {
        height: 150px;
    }
    
    .gif-detail {
        padding: 1rem;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .social-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .social-button {
        justify-content: center;
    }
    
    .gif-actions {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .gif-grid, .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .gif-title {
        font-size: 1rem;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
}