/* 
 * ProfileGazer - App CSS
 * Components and Screens
 */

/* Layout */
.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Hero */
.hero {
    text-align: center;
    margin-bottom: 40px;
}

.hero-title {
    font-size: 2.5rem;
    color: #262626;
    margin-bottom: 10px;
}

.hero-text {
    font-size: 1rem;
    color: #8e8e8e;
}

/* Search Box */
.search-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-input-wrap {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #dbdbdb;
    border-radius: 8px;
    padding: 0 16px;
    height: 50px;
}

.search-at {
    color: #8e8e8e;
    font-size: 1rem;
    margin-right: 4px;
}

.search-input {
    flex: 1;
    height: 100%;
    font-size: 1rem;
    color: #262626;
}

.search-input::placeholder {
    color: #8e8e8e;
}

.search-btn {
    background: #0095f6;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    padding: 14px 24px;
    border-radius: 8px;
    transition: background 0.2s;
}

.search-btn:hover {
    background: #0086e0;
}

.search-btn:disabled {
    background: #b2dffc;
    cursor: not-allowed;
}

.search-error {
    color: #ed4956;
    font-size: 0.875rem;
    text-align: center;
    min-height: 20px;
}

/* Loader */
.loader {
    text-align: center;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #dbdbdb;
    border-top-color: #0095f6;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}

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

.loader-text {
    color: #8e8e8e;
    font-size: 1rem;
}

/* Back Button */
.back-btn {
    color: #0095f6;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 24px;
    padding: 8px 0;
}

.back-btn:hover {
    color: #0086e0;
}

/* Profile Header */
.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.profile-pic {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    background: #dbdbdb;
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-name {
    font-size: 1.25rem;
    color: #262626;
    margin-bottom: 4px;
}

.profile-username {
    font-size: 0.875rem;
    color: #8e8e8e;
    margin-bottom: 8px;
}

.profile-bio {
    font-size: 0.875rem;
    color: #262626;
    white-space: pre-wrap;
}

/* Profile Stats */
.profile-stats {
    display: flex;
    justify-content: space-around;
    padding: 16px 0;
    border-top: 1px solid #dbdbdb;
    border-bottom: 1px solid #dbdbdb;
    margin-bottom: 24px;
}

.stat {
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 1.125rem;
    font-weight: 600;
    color: #262626;
}

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

/* Stories Section */
.section-title {
    font-size: 1rem;
    color: #262626;
    margin-bottom: 16px;
}

.stories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.story-item {
    position: relative;
    aspect-ratio: 9 / 16;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.story-item img,
.story-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-type {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 0.625rem;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Debug Section */
.debug-section {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #dbdbdb;
}

.raw-response {
    background: #262626;
    color: #00ff00;
    padding: 16px;
    border-radius: 8px;
    max-height: 400px;
    overflow: auto;
    font-size: 0.75rem;
}

/* Error Box */
.error-box {
    text-align: center;
    padding: 40px 20px;
}

.error-icon {
    width: 60px;
    height: 60px;
    line-height: 60px;
    font-size: 2rem;
    font-weight: 600;
    color: #ed4956;
    border: 3px solid #ed4956;
    border-radius: 50%;
    margin: 0 auto 20px;
}

.error-title {
    font-size: 1.5rem;
    color: #262626;
    margin-bottom: 12px;
}

.error-message {
    color: #8e8e8e;
    margin-bottom: 24px;
}

/* Responsive */
@media (min-width: 480px) {
    .search-box {
        flex-direction: row;
    }
    
    .search-input-wrap {
        flex: 1;
    }
    
    .search-btn {
        width: auto;
    }
}
