/* base styles, feel free to edit */
html, body {
    margin: 0;
    padding: 0;
    background-color: #fafafa;
    height: 100%;
    font-family: -apple-system, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* Login form styles */
#login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

#login-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

#login-form h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #333;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

#login-submit {
    width: 100%;
    padding: 0.75rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 1rem;
}

#login-submit:hover {
    background-color: #0056b3;
}

#login-submit:active {
    background-color: #004085;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 0.75rem;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-top: 1rem;
}

.banner {
    background-color: #007bff;
    color: white;
    padding: 1rem;
    text-align: center;
}

.banner h1 {
    margin: 0;
}

footer {
    text-align: center;
    padding: 1rem;
    color: #666;
}

 /* Register form styles */
#register-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

#register-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

#register-form h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #333;
}

#register-submit {
    width: 100%;
    padding: 0.75rem;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 1rem;
}

#register-submit:hover {
    background-color: #218838;
}

#register-submit:active {
    background-color: #1e7e34;
}

.form-links {
    text-align: center;
    margin-top: 1rem;
}

.form-links a {
    color: #007bff;
    text-decoration: none;
}

.form-links a:hover {
    text-decoration: underline;
}

.hidden {
    display: none !important;
}

/* Error Popup Styles */
.error-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.error-popup-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.error-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #ddd;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.error-popup-header h3 {
    margin: 0;
    color: #dc3545;
    font-size: 1.25rem;
}

.error-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.error-close-btn:hover {
    background-color: #e9ecef;
    color: #000;
}

.error-popup-body {
    padding: 1.5rem;
    color: #333;
    line-height: 1.5;
}

/* Dashboard/Home Page Styles */
#dashboard-container {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 80vh;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #ddd;
}

.dashboard-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.75rem;
}

.logout-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.logout-btn:hover {
    background-color: #c82333;
}

.logout-btn:active {
    background-color: #bd2130;
}

.dashboard-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.dashboard-content p {
    color: #666;
    font-size: 1.1rem;
    margin: 0;
}

/* App Layout Styles */
.app-layout {
    display: flex;
    height: calc(100vh - 120px); /* Adjust for header and footer */
    min-height: 600px;
}

/* Sidebar Styles */
.sidebar {
    width: 300px;
    background-color: #2c3e50;
    color: white;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 1rem 1.5rem;
    background-color: #34495e;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #4a5f7a;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: white;
}

.sidebar .logout-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.channel-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.channel-section {
    margin-bottom: 1.5rem;
}

.channel-section-title {
    padding: 0.5rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #bdc3c7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.channel-container {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    border: none;
    background: none;
    color: white;
    width: 100%;
    text-align: left;
}

.channel-container:hover {
    background-color: #34495e;
}

.channel-container.active {
    background-color: #3498db;
}

.channel-icon {
    margin-right: 0.75rem;
    font-size: 1rem;
}

.channel-name {
    flex: 1;
    font-size: 1rem;
    font-weight: 500;
}

/* Visual distinction for channel types */
.channel-public {
    border-left: 3px solid #27ae60;
}

.channel-private {
    border-left: 3px solid #e74c3c;
}

.loading {
    padding: 1rem 1.5rem;
    color: #bdc3c7;
    font-style: italic;
}

/* Main Content Styles */
.main-content {
    flex: 1;
    background-color: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content-view {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dashboard-welcome {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
    padding: 2rem;
}

.dashboard-welcome h2 {
    margin: 0 0 1rem 0;
    color: #333;
    font-size: 2rem;
}

.dashboard-welcome p {
    color: #666;
    font-size: 1.1rem;
    margin: 0;
}

/* Channel View Styles */
.channel-header {
    padding: 1rem 2rem;
    border-bottom: 1px solid #ddd;
    background-color: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.channel-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

#channel-details-toggle {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Channel Details Container */
.channel-details {
    position: absolute;
    top: 0;
    right: 0;
    width: 400px;
    height: 100%;
    background: white;
    border-left: 1px solid #ddd;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
    overflow-y: auto;
    transform: translateX(0);
    transition: transform 0.3s ease;
}

.channel-details.hidden {
    transform: translateX(100%);
}

.channel-details-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #ddd;
    background-color: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.channel-details-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.25rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.close-btn:hover {
    background-color: #e9ecef;
    color: #000;
}

.channel-details-content {
    padding: 1.5rem;
}

/* Channel Info Display */
.channel-info-section {
    margin-bottom: 2rem;
}

.info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    position: relative;
}

.info-item label {
    font-weight: 600;
    color: #333;
    min-width: 80px;
    margin-right: 1rem;
    margin-bottom: 0;
    font-size: 0.9rem;
}

.info-value {
    flex: 1;
    color: #666;
    line-height: 1.4;
    word-wrap: break-word;
}

.edit-btn {
    background: none;
    border: none;
    padding: 0.25rem;
    margin-left: 0.5rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    font-size: 0.875rem;
}

.edit-btn:hover {
    opacity: 1;
}

/* Channel Edit Section */
.channel-edit-section {
    margin-bottom: 2rem;
}

.channel-edit-section .form-group {
    margin-bottom: 1rem;
}

.channel-edit-section label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.channel-edit-section input,
.channel-edit-section textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.channel-edit-section input:focus,
.channel-edit-section textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.channel-edit-section textarea {
    resize: vertical;
    min-height: 80px;
}

/* Channel Actions Section */
.channel-actions-section {
    border-top: 1px solid #ddd;
    padding-top: 1.5rem;
}

.action-group {
    text-align: center;
}

.action-note {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #666;
    line-height: 1.4;
}

/* Button Styles for Channel Details */
.btn-danger {
    padding: 0.75rem 1.5rem;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-danger:active {
    background-color: #bd2130;
}

/* Message Input Area */
.message-input {
    border-top: 1px solid #ddd;
    padding: 1rem 2rem;
    background-color: #f8f9fa;
}

.message-input-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

#message-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

#message-input:focus {
    border-color: #007bff;
}

#message-input:disabled {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

#send-message-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    white-space: nowrap;
}

#send-message-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* Channel View Layout Adjustments */
#channel-view {
    position: relative;
}

#channel-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

/* Channel messages scrollable area */
.channel-messages-scroll {
    height: calc(100vh - 280px);
}

/* Responsive Design for Channel Details */
@media (max-width: 1024px) {
    .channel-details {
        width: 350px;
    }
}

@media (max-width: 768px) {
    .channel-details {
        width: 100%;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1000;
    }
    
    .channel-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .channel-actions {
        justify-content: center;
    }
    
    .message-input {
        padding: 1rem;
    }
    
    .info-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .info-item label {
        min-width: auto;
        margin-right: 0;
        margin-bottom: 0.25rem;
    }
    
    .edit-btn {
        position: absolute;
        top: 0;
        right: 0;
    }
}

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

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

.channel-details.show {
    animation: slideInRight 0.3s ease;
}

.channel-details.hide {
    animation: slideOutRight 0.3s ease;
}

/* Loading and Empty States */
.details-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: #666;
    font-style: italic;
}

.no-permission {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.no-permission h4 {
    margin: 0 0 1rem 0;
    color: #333;
}

/* Focus and Accessibility */
.channel-details:focus-within {
    box-shadow: -2px 0 10px rgba(0, 123, 255, 0.3);
}

button:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

button:focus:not(:focus-visible) {
    outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .channel-details {
        border-left: 2px solid #000;
    }
    
    .info-item {
        border-bottom: 1px solid #ccc;
        padding-bottom: 0.5rem;
    }
}

/* Create Channel Button Styles */
.create-channel-btn {
    margin-top: 2rem;
    padding: 1rem 2rem;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.create-channel-btn:hover {
    background-color: #218838;
}

.create-channel-btn:active {
    background-color: #1e7e34;
}

/* Create Channel Popup Styles */
.create-channel-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.create-channel-popup-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.create-channel-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #ddd;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.create-channel-popup-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.25rem;
}

.create-channel-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.create-channel-close-btn:hover {
    background-color: #e9ecef;
    color: #000;
}

.create-channel-popup-body {
    padding: 1.5rem;
}
/* Form styles for create channel */
.create-channel-popup-body .form-group {
    margin-bottom: 1.5rem;
}

.create-channel-popup-body textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.create-channel-popup-body textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.checkbox-group {
    margin-bottom: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0.5rem;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 0.75rem;
    transform: scale(1.2);
}

.checkbox-text {
    font-size: 1rem;
    color: #333;
}

.form-help {
    display: block;
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.25rem;
}

.required {
    color: #dc3545;
    font-weight: bold;
}
/* Form Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
}

.btn-primary {
    padding: 0.75rem 1.5rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-primary:active {
    background-color: #004085;
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-secondary:active {
    background-color: #545b62;
}
/* Responsive Design */
@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
        height: auto;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        order: 2;
    }
    
    .main-content {
        order: 1;
        min-height: 50vh;
    }
}

/* Profile image styles */
.own-profile-image {
    max-width: 150px;
}

/* Image preview styles */
.image-preview-size {
    max-height: 100px;
}
