/* Common Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #fafafa;
    color: #262626;
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.container {
    width: 100%;
    max-width: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

header {
    background: #3897f0;
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

header h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

.back-btn {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

main {
    padding: 25px;
}

.search-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

#profile-url {
    padding: 15px;
    border: 1px solid #dbdbdb;
    border-radius: 8px;
    font-size: 1rem;
    width: 100%;
    transition: border-color 0.3s;
}

#profile-url:focus {
    border-color: #3897f0;
    outline: none;
    box-shadow: 0 0 0 2px rgba(56, 151, 240, 0.2);
}

button {
    padding: 15px;
    background-color: #3897f0;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    width: 100%;
}

button:hover {
    background-color: #2680d9;
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

.profile-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin: 20px 0;
}

.stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #efefef;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    display: block;
    color: #262626;
}

.stat-label {
    font-size: 0.9rem;
    color: #8e8e8e;
}

.profile-info {
    text-align: center;
    margin-bottom: 20px;
}

.username {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.handle {
    color: #3897f0;
    margin-bottom: 10px;
    font-weight: 500;
}

.bio {
    color: #8e8e8e;
    font-size: 0.95rem;
}

.actions {
    display: flex;
    gap: 10px;
}

.actions button {
    flex: 1;
}

.content-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 25px 0;
}

.content-options button {
    padding: 18px 10px;
    background: #f8f9fa;
    color: #262626;
    border: 1px solid #dbdbdb;
    font-size: 1rem;
}

.content-options button:hover {
    background: #e9f0f8;
    border-color: #3897f0;
}

.last-update {
    text-align: center;
    color: #8e8e8e;
    font-size: 0.9rem;
    margin: 20px 0;
}

.change-user {
    margin-top: 25px;
}

.post-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 25px 0;
}

.post {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #3897f0;
}

.post h3 {
    margin-bottom: 8px;
    font-size: 1.2rem;
}

.post p {
    color: #666;
}

.show-all {
    margin: 20px 0;
}

.media-view {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin: 20px 0;
}

.media-header {
    text-align: center;
    margin-bottom: 15px;
}

.media-header h2 {
    color: #3897f0;
    font-size: 1.3rem;
}

.media-container {
    margin: 20px 0;
    text-align: center;
}

.media-container img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.media-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 15px 0;
    font-size: 1.1rem;
    color: #666;
}

.media-footer {
    text-align: center;
    margin: 10px 0;
    font-weight: 500;
}

.legal-content {
    padding: 20px 0;
}

.legal-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
    justify-content: center;
}

.legal-nav a {
    color: #3897f0;
    text-decoration: none;
    font-size: 0.95rem;
}

.legal-links {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 30px 0;
}

.legal-links a {
    color: #262626;
    text-decoration: none;
    font-weight: 500;
    text-align: center;
    padding: 10px;
    background: #f1f5f9;
    border-radius: 8px;
    transition: background 0.3s;
}

.legal-links a:hover {
    background: #e2e8f0;
}

.disclaimer {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin: 30px 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

.copyright {
    text-align: center;
    color: #8e8e8e;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #efefef;
}

footer {
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    border-top: 1px solid #efefef;
    font-size: 0.9rem;
}

footer a {
    color: #3897f0;
    text-decoration: none;
    margin: 0 8px;
}

footer a:hover {
    text-decoration: underline;
}

/* Accessibility */
:focus {
    outline: 3px solid #3897f0;
    outline-offset: 2px;
}

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

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        border-radius: 0;
        min-height: 100vh;
    }
    
    body {
        padding: 0;
        background: white;
    }
    
    header {
        padding: 15px;
    }
    
    main {
        padding: 20px;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .content-options {
        grid-template-columns: 1fr;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background: #121212;
        color: #e0e0e0;
    }
    
    .container {
        background: #1e1e1e;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }
    
    header {
        background: #0d47a1;
    }
    
    .profile-card, .media-view, .post {
        background: #252525;
    }
    
    .stat-value {
        color: #ffffff;
    }
    
    footer {
        background: #1a1a1a;
        border-top: 1px solid #333;
    }
    
    #profile-url {
        background: #333;
        border-color: #444;
        color: #fff;
    }
    
    button {
        background: #0d47a1;
    }
    
    button:hover {
        background: #1565c0;
    }
    
    .content-options button {
        background: #252525;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .content-options button:hover {
        background: #333;
    }
}