.tiktok-story-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
}

.tiktok-story-wrapper {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    color: white;
}

.tiktok-story-wrapper h2 {
    margin: 0 0 10px 0;
    font-size: 32px;
    font-weight: 700;
    text-align: center;
}

.tiktok-story-wrapper p {
    text-align: center;
    margin: 0 0 30px 0;
    opacity: 0.9;
    font-size: 16px;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.story-input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    outline: none;
    background: rgba(255, 255, 255, 0.95);
}

.story-input:focus {
    background: white;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.view-btn {
    padding: 15px 40px;
    background: #ff0050;
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.view-btn:hover {
    background: #e6004a;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 0, 80, 0.4);
}

.view-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.loading {
    text-align: center;
    padding: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-top: 20px;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.story-result {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 25px;
    margin-top: 20px;
}

.story-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.story-user-info {
    flex: 1;
}

.story-username {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.story-count {
    font-size: 14px;
    opacity: 0.8;
    margin: 5px 0 0 0;
}

.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.story-item {
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    overflow: hidden;
    aspect-ratio: 9/16;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.story-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.story-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, transparent 30%, transparent 70%, rgba(0,0,0,0.5) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 15px;
}

.story-type-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
}

.story-download-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #00f2ea 0%, #00d9d2 100%);
    border: none;
    border-radius: 8px;
    color: #333;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.story-download-btn:hover {
    background: linear-gradient(135deg, #00d9d2 0%, #00c4bc 100%);
    transform: translateY(-2px);
}

/* Story Modal */
.story-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    justify-content: center;
    align-items: center;
}

.story-modal.active {
    display: flex;
}

.story-modal-content {
    position: relative;
    max-width: 500px;
    max-height: 90vh;
    background: black;
    border-radius: 15px;
    overflow: hidden;
}

.story-modal video,
.story-modal img {
    width: 100%;
    height: auto;
    max-height: 90vh;
    object-fit: contain;
}

.story-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.story-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
}

.story-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.story-nav.prev {
    left: 20px;
}

.story-nav.next {
    right: 20px;
}

.error {
    background: rgba(255, 0, 0, 0.2);
    border: 2px solid rgba(255, 0, 0, 0.5);
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    text-align: center;
    font-weight: 600;
}

.info-box {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    margin-top: 30px;
    text-align: left;
}

.info-box strong {
    font-size: 16px;
}

.info-box ol {
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.info-box li {
    margin: 8px 0;
    opacity: 0.9;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .tiktok-story-wrapper {
        padding: 25px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .view-btn {
        width: 100%;
    }
    
    .stories-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .story-modal-content {
        max-width: 95%;
    }
}
