* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Layout with Sidebar */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    margin: 0;
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.sidebar-header {
    padding: 30px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-header h1 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
}

.sidebar-header p {
    margin: 5px 0 0 0;
    font-size: 0.85em;
    opacity: 0.8;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 25px;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 4px solid transparent;
    font-size: 1em;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: white;
}

.menu-item.active {
    background: rgba(255, 255, 255, 0.2);
    border-left-color: white;
    font-weight: 600;
}

.menu-icon {
    font-size: 1.3em;
    width: 25px;
    text-align: center;
}

.main-content {
    margin-left: 260px;
    flex: 1;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.content-wrapper {
    padding: 20px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 0.85em;
    opacity: 0.7;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.sidebar-overlay {
    display: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.content {
    padding: 40px;
}

.step-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    gap: 20px;
}

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

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #666;
}

.step.active .step-number {
    background: #667eea;
    color: white;
}

.step-label {
    font-weight: 500;
    color: #666;
}

.step.active .step-label {
    color: #667eea;
}

.arrow {
    color: #ccc;
    font-size: 1.5em;
}

.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.search-box {
    margin-bottom: 30px;
}

.search-box input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
}

.filter-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.filter-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.filter-input:focus {
    outline: none;
    border-color: #667eea;
}

.select-all-wrapper {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.select-all-wrapper label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
}

.select-all-wrapper input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.livestream-list {
    display: grid;
    gap: 15px;
    max-height: 600px;
    overflow-y: auto;
    padding: 10px;
}

.livestream-item {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s;
    cursor: pointer;
    background: white;
}

.livestream-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.livestream-item.selected {
    border-color: #667eea;
    background: #f0f4ff;
}

.livestream-item label {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    cursor: pointer;
}

.livestream-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 5px;
    cursor: pointer;
    flex-shrink: 0;
}

.livestream-info {
    flex: 1;
}

.livestream-name {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.livestream-details {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.9em;
    color: #666;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.detail-label {
    font-weight: 500;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.status-live {
    background: #4caf50;
    color: white;
}

.status-ended {
    background: #9e9e9e;
    color: white;
}

.selected-count {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #667eea;
    color: white;
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    font-weight: 600;
    animation: fadeIn 0.3s;
}

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

.action-buttons {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn {
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: #e0e0e0;
    color: #666;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #c62828;
}

.success-message {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #2e7d32;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state svg {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

/* Scrollbar Styling */
.livestream-list::-webkit-scrollbar {
    width: 8px;
}

.livestream-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.livestream-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.livestream-list::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Sidebar Mobile */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.open {
        display: block;
    }
    
    /* Container */
    .container {
        margin: 0;
        border-radius: 0;
    }
    
    .header h1 {
        font-size: 1.8em;
    }
    
    .content {
        padding: 20px;
    }
    
    .step-indicator {
        flex-direction: column;
        gap: 10px;
    }
    
    .arrow {
        transform: rotate(90deg);
    }
    
    .livestream-details {
        flex-direction: column;
        gap: 8px;
    }
    
    .selected-count {
        bottom: 20px;
        right: 20px;
        left: 20px;
        text-align: center;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .filter-box {
        grid-template-columns: 1fr !important;
    }
    
    .filter-box > div {
        margin-bottom: 10px;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .tags-grid {
        grid-template-columns: 1fr;
    }
}

/* Step 2 Specific Styles */
.selected-livestreams-summary {
    background: #f0f4ff;
    border-left: 4px solid #667eea;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.selected-livestreams-summary h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.livestream-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.livestream-chip {
    background: white;
    padding: 8px 15px;
    border-radius: 20px;
    border: 2px solid #667eea;
    color: #667eea;
    font-weight: 500;
    font-size: 0.9em;
}

.tags-section {
    margin-bottom: 30px;
}

.group-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.group-header:hover {
    opacity: 0.9;
}

.group-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.9em;
}

.tags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
    margin-bottom: 30px;
}

.tag-item {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 15px;
    transition: all 0.3s;
    cursor: pointer;
    background: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tag-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.tag-item.selected {
    border-color: #667eea;
    background: #f0f4ff;
}

.tag-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.tag-color-indicator {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.tag-name {
    flex: 1;
    font-weight: 500;
    color: #333;
}

.tag-badge {
    background: #e0e0e0;
    color: #666;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 600;
}

.tag-badge.system {
    background: #ffebee;
    color: #c62828;
}

.collapsible-group {
    margin-bottom: 20px;
}

.collapse-icon {
    transition: transform 0.3s;
}

.collapse-icon.collapsed {
    transform: rotate(-90deg);
}

.group-content {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.group-content.collapsed {
    max-height: 0;
}

/* Step 3 Specific Styles */
.summary-section {
    background: #f0f4ff;
    border-left: 4px solid #667eea;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.summary-section h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.summary-box {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.summary-box h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1em;
}

.item-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.item-chip {
    background: #f5f5f5;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tag-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.info-box {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.info-box strong {
    color: #856404;
}

.calculation-box {
    background: white;
    border: 2px solid #667eea;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 30px;
}

.calculation-box .big-number {
    font-size: 3em;
    font-weight: bold;
    color: #667eea;
    margin: 10px 0;
}

.calculation-box .formula {
    color: #666;
    font-size: 1.1em;
    margin-top: 10px;
}

.progress-container {
    margin: 30px 0;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.results-section {
    margin-top: 30px;
}

.result-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.result-item.success {
    border-color: #4caf50;
    background: #f1f8f4;
}

.result-item.error {
    border-color: #f44336;
    background: #ffebee;
}

.result-icon {
    font-size: 2em;
    flex-shrink: 0;
}

.result-info {
    flex: 1;
}

.result-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.result-details {
    font-size: 0.9em;
    color: #666;
}

.result-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.badge-success {
    background: #4caf50;
    color: white;
}

.badge-error {
    background: #f44336;
    color: white;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
}

.sending-status {
    text-align: center;
    padding: 40px;
    background: #f0f4ff;
    border-radius: 8px;
    margin: 20px 0;
}

.sending-status h3 {
    color: #667eea;
    margin-bottom: 20px;
}


