* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

/* Login Page */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 420px;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 35px;
}

.login-header h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}

.login-header p {
    color: #666;
    font-size: 15px;
}

/* Main Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    padding: 25px 30px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

@media (max-width: 968px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.card h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 25px;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card h2::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.card h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #4a5568;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #667eea;
}

.form-group label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-danger {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #718096;
    color: white;
    box-shadow: 0 4px 15px rgba(113, 128, 150, 0.2);
}

.btn-secondary:hover {
    background: #4a5568;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(113, 128, 150, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #fc5c65 0%, #eb3b5a 100%);
    color: white;
    width: 100%;
    box-shadow: 0 4px 15px rgba(252, 92, 101, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(252, 92, 101, 0.4);
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
}

/* Proxy Management */
.proxy-controls {
    margin: 25px 0;
}

.proxy-list {
    max-height: 350px;
    overflow-y: auto;
    padding-right: 5px;
}

.proxy-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    margin-bottom: 12px;
    background: #f7fafc;
    border-radius: 12px;
    border-left: 4px solid #cbd5e0;
    transition: all 0.3s ease;
}

.proxy-item:hover {
    background: #edf2f7;
    transform: translateX(4px);
}

.proxy-item.live {
    border-left-color: #48bb78;
    background: #f0fff4;
}

.proxy-item.dead {
    border-left-color: #f56565;
    background: #fff5f5;
}

.proxy-item.checking {
    border-left-color: #ed8936;
    background: #fffaf0;
}

.proxy-info {
    flex: 1;
}

.proxy-info strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #2d3748;
}

.proxy-status {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.proxy-status.live {
    background: #c6f6d5;
    color: #22543d;
}

.proxy-status.dead {
    background: #fed7d7;
    color: #742a2a;
}

.proxy-status.checking {
    background: #feebc8;
    color: #7c2d12;
}

.proxy-actions {
    display: flex;
    gap: 10px;
}

/* Sessions Grid */
.sessions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.session-card {
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.session-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.session-card:hover::before {
    opacity: 1;
}

.session-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.session-username {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 18px;
}

.session-info {
    font-size: 14px;
    margin-bottom: 10px;
    opacity: 0.95;
    display: flex;
    align-items: center;
    gap: 8px;
}

.session-status {
    margin-top: 15px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}

/* Bot Session Page */
.back-link {
    color: #667eea;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 15px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.back-link:hover {
    gap: 10px;
}

.bot-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.bot-info-item {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.bot-info-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

.bot-info-item .icon {
    font-size: 28px;
}

.bot-info-item span:not(.icon) {
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
}

.status-box {
    padding: 18px 24px;
    margin-bottom: 25px;
    border-radius: 12px;
    font-weight: 600;
    text-align: center;
    font-size: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.status-box.success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.status-box.error {
    background: linear-gradient(135deg, #fc5c65 0%, #eb3b5a 100%);
    color: white;
}

.status-box.warning {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
}

/* Chat Display */
.chat-display {
    height: 450px;
    overflow-y: auto;
    background: #f7fafc;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
}

.chat-message {
    padding: 12px 16px;
    margin-bottom: 10px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.chat {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    word-wrap: break-word;
}

.chat-message.chat strong {
    font-weight: 700;
    margin-right: 4px;
}

.chat-message.error {
    background: #fff5f5;
    color: #742a2a;
    border-left: 4px solid #fc5c65;
}

.chat-message.success {
    background: #f0fff4;
    color: #22543d;
    border-left: 4px solid #48bb78;
}

.chat-timestamp {
    font-size: 11px;
    opacity: 0.6;
    margin-left: 10px;
    font-weight: 600;
}

/* Control Panel */
.control-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 2px solid #e2e8f0;
}

.control-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 18px;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 30px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e0;
    transition: 0.3s;
    border-radius: 30px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle input:checked + .toggle-slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.help-text {
    font-size: 13px;
    color: #718096;
    margin-top: 10px;
    font-style: italic;
}

.error-message {
    color: #742a2a;
    font-size: 14px;
    font-weight: 600;
    margin-top: 12px;
    padding: 12px 16px;
    background: #fff5f5;
    border-radius: 8px;
    border-left: 4px solid #fc5c65;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #edf2f7;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .bot-info {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 20px;
    }
    
    .login-card {
        padding: 35px 25px;
    }
}