:root {
    --twitch-purple: #9146FF;
    --twitch-purple-hover: #772ce8;
    --twitch-dark: #0E0E10;
    --twitch-darker: #0a0a0c;
    --twitch-light: #F0F0F0;
    --twitch-gray: #18181b;
    --twitch-gray-hover: #1f1f23;
    --twitch-text-light: #efeff1;
    --twitch-text-gray: #adadb8;
    --shadow-color: rgba(0, 0, 0, 0.4);
    --success-green: #00c875;
    --animation-timing: 0.3s;
}

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

body {
    background-color: var(--twitch-dark);
    color: var(--twitch-light);
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: bold;
}

.logo-icon {
    color: var(--twitch-purple);
    font-size: 28px;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn {
    background-color: var(--twitch-purple);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color var(--animation-timing), transform var(--animation-timing);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    background-color: var(--twitch-purple-hover);
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.btn-large {
    padding: 14px 28px;
    font-size: 16px;
}

.icon-btn {
    background: transparent;
    color: var(--twitch-text-light);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color var(--animation-timing), color var(--animation-timing);
}

.icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--twitch-purple);
}

.btn:disabled {
    background-color: #6441a4;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Animation Classes */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn var(--animation-timing) ease;
}

.fade-in-up {
    animation: fadeInUp var(--animation-timing) ease;
}

.fade-out {
    animation: fadeOut var(--animation-timing) ease forwards;
}

.slide-in {
    animation: slideIn var(--animation-timing) ease;
}

.slide-out {
    animation: slideOut var(--animation-timing) ease forwards;
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* Login Section */
.login-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-content {
    text-align: center;
    max-width: 500px;
    padding: 40px;
    background-color: var(--twitch-gray);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.login-section h2 {
    margin-bottom: 20px;
    font-size: 28px;
}

.login-section p {
    margin-bottom: 30px;
    color: var(--twitch-text-gray);
    line-height: 1.6;
}

/* Streams Section */
.search-container {
    position: relative;
    margin-bottom: 30px;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--twitch-text-gray);
}

.search-bar {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: var(--twitch-gray);
    color: white;
    font-size: 16px;
    transition: border-color var(--animation-timing), box-shadow var(--animation-timing);
}

.search-bar:focus {
    outline: none;
    border-color: var(--twitch-purple);
    box-shadow: 0 0 0 2px rgba(145, 70, 255, 0.3);
}

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

.stream-card {
    background-color: var(--twitch-gray);
    border-radius: 10px;
    overflow: hidden;
    transition: transform var(--animation-timing), box-shadow var(--animation-timing);
    cursor: pointer;
    position: relative;
}

.stream-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.stream-thumbnail {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    transition: transform var(--animation-timing);
}

.stream-card:hover .stream-thumbnail {
    transform: scale(1.05);
}

.live-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #e91916;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stream-info {
    padding: 15px;
}

.stream-title {
    font-weight: bold;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.stream-channel {
    color: var(--twitch-purple);
    margin-bottom: 8px;
    font-weight: 500;
}

.stream-viewers {
    font-size: 0.9em;
    color: var(--twitch-text-gray);
    display: flex;
    align-items: center;
    gap: 5px;
}

.stream-category {
    font-size: 0.9em;
    color: var(--twitch-text-gray);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* User Profile */
.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 20px;
    transition: background-color var(--animation-timing);
}

.user-profile:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--twitch-purple);
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 50px 0;
}

.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top: 4px solid var(--twitch-purple);
    animation: spin 1s linear infinite;
}

.no-streams {
    text-align: center;
    color: var(--twitch-text-gray);
    padding: 40px 0;
    background-color: var(--twitch-gray);
    border-radius: 8px;
    font-size: 16px;
}

/* Lurking Container */
.lurking-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    background-color: var(--twitch-darker);
    border-radius: 10px;
    z-index: 100;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transition: transform var(--animation-timing), box-shadow var(--animation-timing), width var(--animation-timing), height var(--animation-timing);
    width: 800px;
    height: 500px;
    animation: slideInRight var(--animation-timing) ease;
}

.lurking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lurking-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lurking-channel-name {
    font-weight: bold;
    color: var(--twitch-purple);
}

.lurking-controls {
    display: flex;
    gap: 10px;
}

.lurking-control-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.7;
    transition: opacity var(--animation-timing), color var(--animation-timing);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.lurking-control-btn:hover {
    opacity: 1;
    color: var(--twitch-purple);
    background-color: rgba(255, 255, 255, 0.1);
}

.lurking-content {
    display: flex;
    width: 100%;
    height: calc(100% - 50px);
    position: relative;
}

.lurking-player {
    width: 500px;
    height: 100%;
    border: none;
    transition: width var(--animation-timing);
}

.lurking-chat {
    width: 300px;
    height: 100%;
    border: none;
    transition: width var(--animation-timing);
}

.minimized {
    transform: translateY(calc(100% - 50px));
}

.channel-points {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #fcb001;
    font-weight: bold;
    margin-left: 10px;
    background-color: rgba(252, 176, 1, 0.1);
    padding: 3px 8px;
    border-radius: 20px;
}

.channel-points-icon {
    width: 18px;
    height: 18px;
}

.points-claimed {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--success-green);
    font-weight: bold;
    margin-left: 10px;
    background-color: rgba(0, 200, 117, 0.1);
    padding: 3px 8px;
    border-radius: 20px;
    animation: fadeInOut 3s ease forwards;
}

.resize-handle {
    position: absolute;
    width: 20px;
    height: 20px;
    bottom: 0;
    right: 0;
    cursor: se-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn var(--animation-timing) ease;
}

.modal-content {
    background-color: var(--twitch-gray);
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: bold;
}

.modal-close {
    background: none;
    border: none;
    color: var(--twitch-text-gray);
    cursor: pointer;
    font-size: 16px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color var(--animation-timing), color var(--animation-timing);
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
}

/* User Info Modal */
.user-info-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.user-avatar-large-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

.user-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--twitch-purple);
    object-fit: cover;
}

.user-stats {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-label {
    color: var(--twitch-text-gray);
    font-weight: 500;
}

.stat-value {
    font-weight: 600;
    color: var(--twitch-text-light);
}

/* Settings Modal */
.settings-group {
    margin-bottom: 25px;
}

.settings-group h4 {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--twitch-purple);
}

.settings-option {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.settings-description {
    display: flex;
    flex-direction: column;
}

.settings-title {
    font-weight: 500;
    margin-bottom: 4px;
}

.settings-info {
    font-size: 12px;
    color: var(--twitch-text-gray);
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--twitch-purple);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--twitch-purple);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Notification */
.notification {
    position: fixed;
    bottom: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: var(--twitch-gray);
    border-left: 4px solid var(--success-green);
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: slideInLeft var(--animation-timing) ease;
}

.notification-icon {
    font-size: 24px;
    color: var(--success-green);
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.notification-message {
    font-size: 14px;
    color: var(--twitch-text-gray);
}

.notification-close {
    background: none;
    border: none;
    color: var(--twitch-text-gray);
    cursor: pointer;
    padding: 5px;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideOut {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    10% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(145, 70, 255, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(145, 70, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(145, 70, 255, 0);
    }
}

/* Responsive Styles */
@media (max-width: 850px) {
    .lurking-container {
        width: 100vw;
        height: 80vh;
        bottom: 0;
        right: 0;
        border-radius: 10px 10px 0 0;
    }

    .lurking-content {
        flex-direction: column;
    }

    .lurking-player {
        width: 100%;
        height: 56.25vw; /* 16:9 aspect ratio */
    }

    .lurking-chat {
        width: 100%;
        height: calc(100% - 56.25vw);
    }

    .streams-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 580px) {
    .nav-controls {
        gap: 8px;
    }

    .user-name {
        display: none;
    }

    .btn {
        padding: 8px 12px;
        font-size: 14px;
    }

    .streams-container {
        grid-template-columns: 1fr;
    }
}