/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Status Panel */
.status-panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.status-item {
    text-align: center;
    padding: 10px;
}

.status-label {
    display: block;
    font-weight: 600;
    color: #666;
    margin-bottom: 5px;
}

.status-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
}

/* Control Panels */
.control-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.panel h2 {
    color: #5865f2;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel h3 {
    color: #333;
    margin: 15px 0 10px 0;
}

/* Form Elements */
.input-group {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.help-text {
    margin-top: 5px;
    margin-bottom: 15px;
    color: #666;
    font-style: italic;
}

.help-text small {
    color: #888;
}

.discord-embed-container {
    margin: 20px 0;
    padding: 20px;
    background: #2f3136;
    border-radius: 8px;
    border: 1px solid #40444b;
}

.discord-embed-container h3 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 18px;
}

#discord-embed-frame {
    width: 100%;
    height: 500px;
    border: none;
    border-radius: 6px;
    background: #36393f;
    overflow: hidden;
}

.embed-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #72767d;
    text-align: center;
}

.embed-placeholder i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #5865f2;
}

.embed-placeholder p {
    font-size: 16px;
    margin: 0;
}

input[type="text"], 
input[type="password"],
select,
textarea {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus, 
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #5865f2;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.form-select {
    min-width: 200px;
}

/* Buttons */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-primary {
    background: #5865f2;
    color: white;
}

.btn-primary:hover {
    background: #4752c4;
}

.btn-success {
    background: #57f287;
    color: white;
}

.btn-success:hover {
    background: #3ba55c;
}

.btn-danger {
    background: #ed4245;
    color: white;
}

.btn-danger:hover {
    background: #c03537;
}

.btn-info {
    background: #5865f2;
    color: white;
}

.btn-info:hover {
    background: #4752c4;
}

.btn-secondary {
    background: #99aab5;
    color: white;
}

.btn-secondary:hover {
    background: #7a8c99;
}

/* Server and Channel Lists */
.list-container {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 10px;
    background: #f8f9fa;
}

.server-item, .channel-item {
    padding: 8px 12px;
    margin: 5px 0;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #5865f2;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.server-item:hover, .channel-item:hover {
    background: #f0f2f5;
}

.loading {
    text-align: center;
    color: #666;
    font-style: italic;
}

/* TTS Controls */
.tts-controls {
    position: relative;
}

.char-count {
    position: absolute;
    bottom: 5px;
    right: 10px;
    font-size: 12px;
    color: #666;
}

/* Log Panel */
.log-panel {
    margin-bottom: 30px;
}

.log-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 15px;
    background: #f8f9fa;
    margin-bottom: 15px;
}

.log-entry {
    padding: 8px 12px;
    margin: 5px 0;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.log-entry.info {
    background: #e3f2fd;
    color: #1976d2;
    border-left: 4px solid #2196f3;
}

.log-entry.success {
    background: #e8f5e8;
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

.log-entry.error {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #f44336;
}

.log-entry.warning {
    background: #fff3e0;
    color: #ef6c00;
    border-left: 4px solid #ff9800;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow: hidden;
}

.modal-content {
    background-color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 15px;
    right: 20px;
}

.close:hover {
    color: #000;
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.setting-group h3 {
    color: #5865f2;
    margin-bottom: 15px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-divider {
    border: none;
    height: 1px;
    background: #e1e5e9;
    margin: 25px 0;
}

.setting-group input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 15px;
    transition: border-color 0.3s ease;
}

.setting-group input:focus {
    outline: none;
    border-color: #5865f2;
    box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.1);
}

/* CAPTCHA Modal specific styles */
.captcha-modal .modal-content {
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    background-color: #36393f;
    color: #fff;
    border: 1px solid #4f545c;
}

.captcha-content h2 {
    color: #fff;
    margin-bottom: 15px;
}

.captcha-content p {
    color: #b9bbbe;
    margin-bottom: 20px;
    line-height: 1.5;
}

.captcha-container {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background: #2f3136;
    border-radius: 8px;
    border: 1px solid #40444b;
}

.captcha-container iframe {
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.captcha-input {
    margin: 20px 0;
}

.captcha-input label {
    display: block;
    color: #fff;
    margin-bottom: 8px;
    font-weight: 600;
}

.captcha-input input {
    width: 100%;
    padding: 12px;
    background: #40444b;
    border: 1px solid #4f545c;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    margin-bottom: 8px;
}

.captcha-input input:focus {
    outline: none;
    border-color: #7289da;
    box-shadow: 0 0 0 2px rgba(114, 137, 218, 0.3);
}

.captcha-input small {
    color: #72767d;
    font-size: 12px;
    line-height: 1.4;
}

.captcha-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.captcha-actions .btn {
    min-width: 120px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .status-panel {
        flex-direction: column;
        gap: 15px;
    }
    
    .control-panels {
        grid-template-columns: 1fr;
    }
    
    .input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 20px;
        top: 20px;
        left: 0;
        transform: none;
        max-height: calc(100vh - 40px);
    }
}

/* Voice Channel Status */
.voice-connected {
    color: #57f287;
}

.voice-disconnected {
    color: #ed4245;
}

/* Authentication Status */
.auth-status {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e1e5e9;
}

.auth-status .status-label {
    font-weight: 600;
    color: #666;
    margin-right: 10px;
}

.auth-status .status-value {
    font-weight: bold;
}

.auth-status .status-value.authenticated {
    color: #57f287;
}

.auth-status .status-value.not-authenticated {
    color: #ed4245;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel {
    animation: fadeIn 0.5s ease-out;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
