* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #e4405f;
    --secondary-color: #3897f0;
    --bg-color: #fafafa;
    --card-bg: #ffffff;
    --text-primary: #262626;
    --text-secondary: #8e8e8e;
    --border-color: #dbdbdb;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --hover-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    background: var(--card-bg);
    padding: 40px 20px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.header-content i {
    font-size: 48px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 10px;
}

/* Controls */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
    gap: 15px;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border-radius: 10px;
    padding: 10px 15px;
    flex: 1;
    min-width: 250px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(56, 151, 240, 0.1);
}

.search-box i {
    color: var(--text-secondary);
    margin-right: 10px;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 15px;
    color: var(--text-primary);
}

.view-toggle {
    display: flex;
    gap: 10px;
}

.view-btn {
    background: var(--bg-color);
    border: none;
    padding: 12px 18px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    color: var(--text-secondary);
}

.view-btn:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
}

.view-btn.active {
    background: var(--secondary-color);
    color: white;
}

/* Stats */
.stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    background: var(--card-bg);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.post-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease;
    min-height: 500px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

/* Instagram Embed */
.instagram-embed {
    width: 100%;
    min-height: 500px;
    max-height: 800px;
    border: none;
    display: block;
}

.post-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

.post-content {
    padding: 15px;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.post-username {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.post-caption {
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
}

.post-date {
    color: var(--text-secondary);
    font-size: 12px;
}

/* List View */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.posts-list .post-card {
    display: block;
    max-width: 540px;
    margin: 0 auto;
}

.posts-list .instagram-embed {
    width: 100%;
    min-height: 600px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    margin: 2% auto;
    width: 90%;
    max-width: 1000px;
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.5);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.3s ease;
}

.close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: rotate(90deg);
}

.modal-body {
    display: flex;
    flex-direction: row;
}

.modal-image {
    flex: 1;
    background: black;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 80vh;
}

.modal-image img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.modal-info {
    width: 350px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header .user-avatar {
    width: 50px;
    height: 50px;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-caption {
    flex: 1;
    line-height: 1.6;
    color: var(--text-primary);
}

.view-original {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.view-original:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(228, 64, 95, 0.4);
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.loader {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-state p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.no-results i {
    font-size: 60px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.no-results p {
    color: var(--text-secondary);
    font-size: 18px;
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }

    .modal-body {
        flex-direction: column;
    }

    .modal-info {
        width: 100%;
        max-height: 40vh;
    }

    .posts-list .post-card {
        flex-direction: column;
    }

    .posts-list .post-image {
        width: 100%;
        height: 300px;
    }

    .controls {
        flex-direction: column;
    }

    .search-box {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .header {
        padding: 30px 15px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }
}


