/* KnuddelChat Login CSS - Knuddels-Style Design */

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

body {
    font-family: 'Verdana', 'Tahoma', sans-serif;
    font-size: 11px;
    overflow: hidden;
    background: #d4e8ff url('/assets/images/background.jpg') repeat;
}

/* Main Background */
.main-background {
    background: linear-gradient(135deg, #87ceeb 0%, #b8d4f1 50%, #d4e8ff 100%);
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.2) 0%, transparent 50%);
}

/* Remember Dialog */
.remember-dialog {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 350px;
    background: linear-gradient(to bottom, #e8f0ff 0%, #d0e0ff 100%);
    border: 2px outset #c0c0c0;
    border-radius: 0;
    box-shadow: 3px 3px 8px rgba(0,0,0,0.3);
    z-index: 10;
}

.dialog-header {
    background: linear-gradient(to bottom, #ff7878 0%, #cc4444 100%);
    color: white;
    padding: 5px 10px;
    font-weight: bold;
    font-size: 11px;
    border-bottom: 1px solid #aa3333;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

.dialog-content {
    padding: 15px;
}

.dialog-input input {
    width: 100%;
    padding: 5px;
    border: 2px inset #c0c0c0;
    background: white;
    font-size: 11px;
    font-family: 'Verdana', sans-serif;
}

/* Main Login Container */
.login-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 650px;
    background: linear-gradient(to bottom, #e8f0ff 0%, #d0e0ff 100%);
    border: 2px outset #c0c0c0;
    border-radius: 0;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.4);
}

.login-header {
    background: linear-gradient(to bottom, #ff7878 0%, #cc4444 100%);
    color: white;
    padding: 8px 15px;
    font-weight: bold;
    font-size: 12px;
    border-bottom: 1px solid #aa3333;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

.login-form {
    display: flex;
    padding: 20px;
    gap: 20px;
}

.form-left {
    flex: 1;
    min-width: 280px;
}

.form-right {
    flex: 1;
    min-width: 280px;
}

/* Form Groups */
.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-weight: bold;
    font-size: 11px;
    color: #333;
    margin-bottom: 3px;
}

.form-input, .form-select {
    width: 100%;
    padding: 4px 6px;
    border: 2px inset #c0c0c0;
    background: white;
    font-size: 11px;
    font-family: 'Verdana', sans-serif;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: #4a90e2;
}

.form-input:read-only {
    background: #f0f0f0;
    color: #666;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checkbox-group label {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
}

/* Buttons */
.login-btn {
    width: 100%;
    padding: 8px 16px;
    background: linear-gradient(to bottom, #4a90e2 0%, #357abd 100%);
    color: white;
    border: 2px outset #4a90e2;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    font-family: 'Verdana', sans-serif;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.3);
}

.login-btn:hover:not(:disabled) {
    background: linear-gradient(to bottom, #5ba0f2 0%, #4080cd 100%);
}

.login-btn:active:not(:disabled) {
    border: 2px inset #4a90e2;
}

.login-btn:disabled {
    background: linear-gradient(to bottom, #cccccc 0%, #aaaaaa 100%);
    color: #666;
    cursor: not-allowed;
    border: 2px outset #cccccc;
}

/* Register Link */
.register-link {
    text-align: center;
    margin-top: 15px;
}

.register-link a {
    color: #4a90e2;
    text-decoration: underline;
    font-size: 11px;
    cursor: pointer;
}

.register-link a:hover {
    color: #357abd;
}

/* Channel List */
.channel-list {
    height: 200px;
    border: 2px inset #c0c0c0;
    background: white;
    overflow-y: auto;
    padding: 5px;
}

.channel-item {
    padding: 5px 8px;
    margin-bottom: 2px;
    cursor: pointer;
    border: 1px solid transparent;
    background: #f8f9fa;
    font-size: 11px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.channel-item:hover:not(.disabled) {
    background: #e3f2fd;
    border-color: #4a90e2;
}

.channel-item.selected {
    background: #4a90e2;
    color: white;
    border-color: #357abd;
}

.channel-item.disabled {
    background: #f0f0f0;
    color: #999;
    cursor: not-allowed;
}

.channel-name {
    font-weight: bold;
}

.channel-theme {
    font-size: 10px;
    color: #666;
    font-style: italic;
}

.channel-item.selected .channel-theme {
    color: #e0e0e0;
}

.channel-users {
    font-size: 10px;
    color: #666;
    background: rgba(255,255,255,0.7);
    padding: 2px 5px;
    border-radius: 3px;
}

.channel-item.selected .channel-users {
    background: rgba(255,255,255,0.9);
    color: #333;
}

/* Register Container */
.register-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    background: linear-gradient(to bottom, #e8f0ff 0%, #d0e0ff 100%);
    border: 2px outset #c0c0c0;
    border-radius: 0;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.4);
}

.register-form {
    padding: 20px;
}

/* Connection Status */
.connection-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 8px 12px;
    border-radius: 0;
    border: 2px outset #c0c0c0;
    background: linear-gradient(to bottom, #e8f0ff 0%, #d0e0ff 100%);
    font-size: 11px;
    font-weight: bold;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.connection-status.connected {
    color: #008000;
}

.connection-status.disconnected {
    color: #cc0000;
}

.connection-status.connecting {
    color: #ff8800;
}

/* Messages */
.error-message, .success-message {
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border: 2px outset #c0c0c0;
    font-size: 11px;
    font-weight: bold;
    z-index: 1000;
    box-shadow: 3px 3px 8px rgba(0,0,0,0.3);
}

.error-message {
    background: linear-gradient(to bottom, #ffcccc 0%, #ffaaaa 100%);
    color: #cc0000;
}

.success-message {
    background: linear-gradient(to bottom, #ccffcc 0%, #aaffaa 100%);
    color: #008000;
}

/* Message Overlay */
.message-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-box {
    background: linear-gradient(to bottom, #e8f0ff 0%, #d0e0ff 100%);
    border: 2px outset #c0c0c0;
    padding: 20px;
    max-width: 400px;
    text-align: center;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.4);
}

.message-content {
    margin-bottom: 15px;
    font-size: 12px;
    color: #333;
}

.message-close {
    padding: 6px 20px;
    background: linear-gradient(to bottom, #4a90e2 0%, #357abd 100%);
    color: white;
    border: 2px outset #4a90e2;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    font-family: 'Verdana', sans-serif;
}

/* Loading Spinner */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    color: #666;
    font-size: 11px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4a90e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Retry Button */
.retry-button {
    width: 100%;
    margin-top: 10px;
    padding: 6px 12px;
    background: linear-gradient(to bottom, #ffaa44 0%, #ff8800 100%);
    color: white;
    border: 2px outset #ffaa44;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    font-family: 'Verdana', sans-serif;
}

.retry-button:hover {
    background: linear-gradient(to bottom, #ffbb55 0%, #ff9911 100%);
}

/* Channel Theme Colors */
.channel-item[data-theme="flirt"] .channel-name {
    color: #e91e63;
}

.channel-item[data-theme="games"] .channel-name {
    color: #4caf50;
}

.channel-item[data-theme="help"] .channel-name {
    color: #2196f3;
}

/* Bootstrap Modal Overrides for Knuddels Style */
.modal-content {
    border: 2px outset #c0c0c0;
    border-radius: 0;
    background: linear-gradient(to bottom, #e8f0ff 0%, #d0e0ff 100%);
    font-family: 'Verdana', sans-serif;
    font-size: 11px;
}

.modal-header {
    background: linear-gradient(to bottom, #4a90e2 0%, #357abd 100%);
    color: white;
    border-bottom: 1px solid #357abd;
    font-weight: bold;
    font-size: 12px;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.3);
}

.modal-body {
    background: white;
    border: 2px inset #c0c0c0;
    margin: 10px;
    padding: 15px;
    font-size: 11px;
}

.modal-footer {
    border-top: 1px solid #c0c0c0;
    background: linear-gradient(to bottom, #f0f0f0 0%, #e0e0e0 100%);
}

.btn {
    border: 2px outset #c0c0c0;
    font-size: 11px;
    font-family: 'Verdana', sans-serif;
    font-weight: bold;
    padding: 6px 12px;
}

.btn-primary {
    background: linear-gradient(to bottom, #4a90e2 0%, #357abd 100%);
    border-color: #4a90e2;
    color: white;
}

.btn-secondary {
    background: linear-gradient(to bottom, #cccccc 0%, #aaaaaa 100%);
    border-color: #cccccc;
    color: #333;
}

.btn-success {
    background: linear-gradient(to bottom, #4caf50 0%, #388e3c 100%);
    border-color: #4caf50;
    color: white;
}

.btn:hover {
    transform: none;
    box-shadow: none;
}

.btn:active {
    border-style: inset;
}

/* Scrollbar Styling */
.channel-list::-webkit-scrollbar {
    width: 16px;
}

.channel-list::-webkit-scrollbar-track {
    background: #f0f0f0;
    border: 1px inset #c0c0c0;
}

.channel-list::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #cccccc 0%, #aaaaaa 100%);
    border: 1px outset #cccccc;
}

.channel-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #bbbbbb 0%, #999999 100%);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .main-background {
        overflow-y: auto;
    }
    
    .remember-dialog,
    .login-container,
    .register-container {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        width: 95%;
        margin: 20px auto;
    }
    
    .login-form {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-left,
    .form-right {
        min-width: auto;
    }
    
    .channel-list {
        height: 150px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .spinner {
        animation: none;
    }
}
