/* Screens */
.screen {
    display: none;
    width: 100vw;
    height: 100vh;
}

.screen.active {
    display: flex;
}

/* Setup Screen */
.setup-container {
    max-width: 500px;
    margin: auto;
    padding: 40px;
    animation: slideUp 0.6s ease;
}

.setup-header {
    text-align: center;
    margin-bottom: 48px;
}

.logo-large {
    animation: fadeIn 0.8s ease;
}

.logo-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.logo-large h1 {
    font-size: 48px;
    font-weight: 300;
    margin-bottom: 8px;
}

.logo-large p {
    color: var(--gray-400);
    font-size: 16px;
}

.setup-form {
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    color: var(--gray-300);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    background: var(--black);
    border: 1px solid var(--gray-800);
    border-radius: 10px;
    padding: 14px 16px;
    color: var(--white);
    font-size: 15px;
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--white);
}

.form-group small {
    display: block;
    color: var(--gray-500);
    font-size: 12px;
    margin-top: 6px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-group label {
    color: var(--gray-300);
    font-size: 14px;
    cursor: pointer;
}

.setup-footer {
    text-align: center;
    color: var(--gray-500);
    font-size: 13px;
    line-height: 1.8;
}

/* App Layout */
.app-layout {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 360px;
    background: var(--gray-900);
    border-right: 1px solid var(--gray-800);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-800);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--white);
    color: var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
}

.user-details h3 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
}

.user-status {
    font-size: 13px;
    color: var(--gray-400);
}

.sidebar-actions {
    padding: 16px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--gray-800);
}

.action-btn {
    flex: 1;
    background: var(--gray-800);
    border: 1px solid var(--gray-700);
    color: var(--white);
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: var(--gray-700);
}

.search-container {
    padding: 16px;
    position: relative;
}

.search-container input {
    width: 100%;
    background: var(--gray-800);
    border: 1px solid var(--gray-700);
    border-radius: 10px;
    padding: 12px 40px 12px 16px;
    color: var(--white);
    font-size: 14px;
}

.search-container input:focus {
    outline: none;
    border-color: var(--gray-600);
}

.search-icon {
    position: absolute;
    right: 28px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--gray-500);
}

.chats-container {
    flex: 1;
    overflow-y: auto;
}

.empty-chats {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    text-align: center;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-chats h3 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
}

.empty-chats p {
    color: var(--gray-500);
    font-size: 14px;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--black);
}

.view {
    display: none;
    flex: 1;
}

.view.active {
    display: flex;
    flex-direction: column;
}

/* Welcome View */
.welcome-container {
    max-width: 900px;
    margin: auto;
    padding: 60px 40px;
    text-align: center;
    animation: fadeIn 0.8s ease;
}

.welcome-icon {
    font-size: 100px;
    margin-bottom: 32px;
}

.welcome-container h1 {
    font-size: 48px;
    font-weight: 300;
    margin-bottom: 16px;
}

.welcome-subtitle {
    color: var(--gray-400);
    font-size: 18px;
    margin-bottom: 48px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 48px;
}

.feature-card {
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    border-color: var(--gray-700);
    transform: translateY(-4px);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--gray-400);
    font-size: 14px;
    line-height: 1.6;
}

/* Chat View */
.chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--gray-900);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--white);
    color: var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
}

.chat-details h3 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 2px;
}

.chat-status {
    font-size: 13px;
    color: var(--gray-500);
}

.chat-status.online {
    color: var(--success);
}

.chat-actions {
    display: flex;
    gap: 4px;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.date-separator {
    text-align: center;
    margin: 24px 0;
}

.date-separator span {
    background: var(--gray-900);
    color: var(--gray-500);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.message-input-container {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-900);
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.input-icon-btn {
    background: transparent;
    border: none;
    color: var(--gray-400);
    font-size: 24px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.input-icon-btn:hover {
    background: var(--gray-900);
    color: var(--white);
}

.message-input-wrapper {
    flex: 1;
    background: var(--gray-900);
    border-radius: 24px;
    padding: 12px 20px;
}

.message-input-wrapper textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 15px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
}

.message-input-wrapper textarea:focus {
    outline: none;
}

.send-btn {
    background: var(--white);
    border: none;
    color: var(--black);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.send-btn:hover {
    transform: scale(1.1);
}

.send-icon {
    font-size: 20px;
}

/* Settings View */
.settings-container {
    flex: 1;
    overflow-y: auto;
}

.settings-header {
    padding: 24px;
    border-bottom: 1px solid var(--gray-900);
    display: flex;
    align-items: center;
    gap: 16px;
}

.back-btn {
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: var(--gray-900);
}

.settings-header h2 {
    font-size: 24px;
    font-weight: 500;
}

.settings-content {
    max-width: 700px;
    margin: 0 auto;
    padding: 32px;
}

.settings-section {
    margin-bottom: 48px;
}

.settings-section h3 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 20px;
    color: var(--gray-300);
}

.setting-item {
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 12px;
}

.setting-item label {
    display: block;
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 8px;
}

.setting-item small {
    display: block;
    color: var(--gray-500);
    font-size: 13px;
    margin-top: 4px;
}

.setting-item input[type="text"],
.setting-item input[type="password"] {
    width: 100%;
    background: var(--black);
    border: 1px solid var(--gray-800);
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--white);
    font-size: 14px;
    margin-bottom: 12px;
}

.setting-item.toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.setting-item input[type="checkbox"] {
    width: 48px;
    height: 28px;
    cursor: pointer;
}

.id-display-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--black);
    border: 1px solid var(--gray-800);
    border-radius: 8px;
    padding: 12px 14px;
}

.id-display-box code {
    flex: 1;
    color: var(--gray-300);
    font-size: 13px;
    word-break: break-all;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--gray-400);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
}

.about-info {
    color: var(--gray-400);
    font-size: 14px;
    line-height: 1.8;
}

.about-info a {
    color: var(--white);
    text-decoration: none;
}

.about-info a:hover {
    text-decoration: underline;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    animation: scaleIn 0.3s ease;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--gray-800);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 500;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--gray-400);
    font-size: 24px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: var(--gray-800);
    color: var(--white);
}

.modal-body {
    padding: 24px;
}

.modal-description {
    color: var(--gray-400);
    font-size: 14px;
    margin-bottom: 20px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--gray-800);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.id-display-large {
    background: var(--black);
    border: 1px solid var(--gray-800);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.id-display-large code {
    color: var(--white);
    font-size: 14px;
    word-break: break-all;
    user-select: all;
}

.qr-section {
    margin-top: 24px;
}

.qr-placeholder {
    background: var(--gray-800);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
}

.qr-icon {
    font-size: 64px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.qr-placeholder p {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.qr-placeholder small {
    color: var(--gray-500);
    font-size: 12px;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
}

.toast {
    background: var(--white);
    color: var(--black);
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    animation: slideInRight 0.3s ease;
}
