* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f8f8f8;
    color: #000;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.search-container {
    max-width: 800px;
    width: 100%;
    margin-bottom: 20px;
}

.search-form {
    display: flex;
    gap: 10px;
    background: #fff;
    padding: 20px;
    border-radius: 24px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #eee;
    border-radius: 100px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: #000;
}

.search-button {
    padding: 12px 30px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 100px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-button:hover {
    background: #333;
    transform: translateY(-1px);
}

.search-examples {
    margin-top: 10px;
    font-size: 13px;
    color: #666;
    text-align: center;
}

.results-container {
    max-width: 700px;
    width: 100%;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-top: 20px;
    display: <?php echo $data ? 'block' : 'none'; ?>;
}

.header {
    padding: 32px;
    background: #fff;
    border-bottom: 1px solid #eee;
    position: relative;
    z-index: 2;
}

.profile-section {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 24px;
}

.profile-image {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.profile-image:hover {
    transform: scale(1.05);
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.username {
    font-size: 15px;
    color: #666;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    color: #666;
    font-size: 14px;
    flex-wrap: wrap;
}

.divider {
    width: 4px;
    height: 4px;
    background: #ddd;
    border-radius: 50%;
}

.contact-info {
    color: #666;
    font-size: 15px;
    margin-bottom: 16px;
}

.links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.link-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f5f5f5;
    border-radius: 100px;
    color: #000;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s ease;
}

.link-item:hover {
    background: #eee;
}

.tabs {
    display: flex;
    padding: 0 32px;
    background: #fff;
    position: relative;
    z-index: 2;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    padding: 16px 24px;
    color: #666;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab.active {
    color: #000;
    border-bottom-color: #000;
}

.tab-content {
    display: none;
    padding: 32px;
    background: #f8f8f8;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 400px;
    min-height: 590px;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tab-content.active {
    display: block;
    opacity: 1;
    position: relative;
}

#info.tab-content {
    min-height: 400px;
}

.info-section {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.info-section:last-child {
    margin-bottom: 0;
}

.info-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #000;
}

.info-row {
    display: flex;
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.info-label {
    width: 140px;
    color: #666;
    font-weight: 500;
}

.info-value {
    flex: 1;
    color: #000;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .search-container {
        padding: 0 10px;
    }

    .search-form {
        flex-direction: column;
        padding: 15px;
    }

    .search-button {
        width: 100%;
    }

    .header {
        padding: 20px;
    }

    .profile-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 16px;
    }

    .profile-info {
        width: 100%;
        text-align: center;
    }

    .profile-name {
        justify-content: center;
        font-size: 24px;
    }

    .username {
        justify-content: center;
    }

    .stats {
        justify-content: center;
    }

    .links {
        justify-content: center;
    }

    .tabs {
        padding: 0 10px;
    }

    .tab {
        padding: 12px 16px;
        font-size: 14px;
    }

    .tab-content {
        padding: 20px;
    }

    .info-section {
        padding: 16px;
    }

    .info-row {
        flex-direction: column;
        gap: 4px;
    }

    .info-label {
        width: 100%;
    }

    .info-value {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .profile-image {
        width: 80px;
        height: 80px;
    }

    .profile-name {
        font-size: 20px;
    }

    .stats {
        font-size: 12px;
    }

    .link-item {
        font-size: 12px;
        padding: 6px 12px;
    }

    .tab {
        padding: 10px 12px;
        font-size: 13px;
    }

    .info-section h3 {
        font-size: 16px;
    }

    .info-row {
        font-size: 13px;
    }
}

@media (max-width: 360px) {
    .profile-image {
        width: 70px;
        height: 70px;
    }

    .profile-name {
        font-size: 18px;
    }

    .tab {
        padding: 8px 10px;
        font-size: 12px;
    }
}

.link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: #000;
    color: #fff;
    border-radius: 100px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
    width: 100%;
    max-width: 150px;
    box-sizing: border-box;
}


.link-button:hover {
    background: #333;
    transform: translateY(-1px);
}

.link-button svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.bio-link {
    color: #000;
    text-decoration: none;
    border-bottom: 1px solid #000;
    transition: opacity 0.2s ease;
}

.bio-link:hover {
    opacity: 0.7;
}

@keyframes storyRing {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.search-container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto 20px auto;
    padding: 20px;
}

.search-form {
    display: flex;
    gap: 10px;
    background: #fff;
    padding: 20px;
    border-radius: 24px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #eee;
    border-radius: 100px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: #000;
}

.search-button {
    padding: 12px 30px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 100px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-button:hover {
    background: #333;
    transform: translateY(-1px);
}

.search-examples {
    margin-top: 10px;
    font-size: 13px;
    color: #666;
    text-align: center;
}

.profile-link {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    transition: transform 0.2s ease;
}

.profile-link:hover {
    transform: scale(1.1);
}

.profile-link svg {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

@media (max-width: 768px) {
    .profile-section {
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
        gap: 16px;
        padding: 16px 0;
    }

    .profile-image {
        width: 65px;
        height: 65px;
        min-width: 65px;
        border: 2px solid #fff;
        margin: 0;
    }

    .profile-info {
        width: 100%;
        text-align: left;
        padding-right: 10px;
    }

    .profile-name {
        justify-content: flex-start;
        font-size: 20px;
        margin-bottom: 2px;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .profile-name .verified svg {
        width: 20px;
        height: 20px;
    }

    .username {
        justify-content: flex-start;
        font-size: 14px;
        color: #666;
        margin-bottom: 8px;
    }

    .stats {
        justify-content: flex-start;
        font-size: 13px;
        margin-bottom: 12px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .divider {
        width: 3px;
        height: 3px;
    }

    .contact-info {
        font-size: 14px;
        margin-bottom: 12px;
        line-height: 1.4;
    }

    .links {
        justify-content: flex-start;
        gap: 8px;
    }

    .link-item {
        font-size: 13px;
        padding: 6px 12px;
    }

    .profile-link svg {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 16px;
    }

    .profile-section {
        margin-bottom: 16px;
    }

    .profile-image {
        width: 60px;
        height: 60px;
        min-width: 60px;
    }

    .profile-name {
        font-size: 18px;
    }

    .username {
        font-size: 13px;
    }

    .stats {
        font-size: 12px;
        gap: 10px;
    }

    .contact-info {
        font-size: 13px;
    }

    .link-item {
        font-size: 12px;
        padding: 5px 10px;
    }
}

@media (max-width: 360px) {
    .header {
        padding: 12px;
    }

    .profile-image {
        width: 55px;
        height: 55px;
        min-width: 55px;
    }

    .profile-name {
        font-size: 16px;
    }

    .stats {
        font-size: 11px;
        gap: 8px;
    }
}

@media (max-width: 768px) {
    .stories-grid, .spotlight-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0;
    }

    .story-card {
        background: transparent;
        box-shadow: none;
        border-radius: 12px;
        overflow: hidden;
    }

    .story-card > div:first-child {
        position: relative;
        padding-top: 177.77%;
        border-radius: 12px;
        overflow: hidden;
    }

    .story-card img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .story-card > div:last-child {
        padding: 8px 0;
    }


    .info-section > div:first-child {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 16px;
        padding: 0 4px;
    }

    .info-section h3 + span {
        background: #f5f5f5;
        padding: 4px 10px;
        border-radius: 100px;
        font-size: 13px;
        color: #666;
    }

    button[onclick*="toggleSort"], 
    button[onclick*="toggleSpotlightSort"] {
        background: transparent;
        padding: 8px 12px;
        border: none;
        font-size: 13px;
        color: #666;
        display: flex;
        align-items: center;
        gap: 4px;
    }

    button[onclick*="toggleSort"] svg, 
    button[onclick*="toggleSpotlightSort"] svg {
        width: 16px;
        height: 16px;
        opacity: 0.6;
    }

    .story-card h4 {
        font-size: 13px;
        margin: 0 0 4px 0;
        color: #666;
    }

    .story-card .subtitle {
        font-size: 12px;
        color: #888;
        margin-bottom: 4px;
    }

    .story-card time {
        font-size: 11px;
        color: #999;
        display: block;
        margin-bottom: 8px;
    }

    .story-card a[download] {
        width: 100%;
        padding: 8px 12px;
        font-size: 13px;
        margin-top: 8px;
        text-align: center;
        background: #000;
        color: #fff;
        border-radius: 100px;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }

    .story-card a[download] svg {
        width: 16px;
        height: 16px;
    }

    .story-card span[style*="background"] {
        font-size: 11px;
        padding: 3px 8px;
    }
}

@media (max-width: 480px) {
    .stories-grid, .spotlight-grid {
        gap: 8px;
    }

    .story-card > div:last-child {
        padding: 6px 0;
    }

    .story-card h4 {
        font-size: 12px;
    }

    .story-card .subtitle {
        font-size: 11px;
    }

    .story-card time {
        font-size: 10px;
    }

    .story-card a[download] {
        font-size: 12px;
        padding: 6px 10px;
    }
}

.search-info {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    padding: 8px 0;
}

.search-counter {
    color: #666;
    font-size: 0.9em;
    background: #f5f5f5;
    padding: 4px 12px;
    border-radius: 100px;
}

.stories-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.stories-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stories-count {
    background: #f5f5f5;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 13px;
    color: #666;
}

@media (max-width: 768px) {
    .stories-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 16px;
        padding: 0 4px;
    }

    .stories-header-left {
        width: 100%;
        justify-content: space-between;
    }

    .stories-count {
        font-size: 12px;
        padding: 3px 8px;
        background: #f0f0f0;
    }

    .stories-header h3 {
        font-size: 16px;
    }

    button[onclick*="toggleSort"],
    button[onclick*="toggleSpotlightSort"] {
        margin-top: 8px;
        justify-content: center;
        background: #f5f5f5;
        padding: 8px;
        border-radius: 100px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .stories-header {
        gap: 6px;
        margin-bottom: 12px;
    }

    .stories-count {
        font-size: 11px;
        padding: 2px 6px;
    }

    .stories-header h3 {
        font-size: 15px;
    }

    button[onclick*="toggleSort"],
    button[onclick*="toggleSpotlightSort"] {
        font-size: 12px;
        padding: 6px;
    }
}
