
:root {
    --primary-color: #212223;
    --dark-color: #1a1a2e;
    --light-color: #f5f5f5;
    --success-color: #28a745;
    --danger-color: #dc3545;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    font-family: 'DM Sans' sans-serif;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background-color: var(--primary-color);
    color: #fff;
    padding: 20px 0;
    text-align: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 8px;
}

.main-content {
    padding: 30px 0;
    min-height: calc(100vh - 140px);
}

.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 25px;
    margin-bottom: 20px;
}

.btn {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.btn:hover {
    background: #7c7c7c;
    transform: translateY(-2px);
}

.btn-block {
    display: block;
    width: 100%;
}

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

/* Screens */
.screen {
    display: none;
}

.active {
    display: block;
}

/* Welcome Screen */
.welcome-screen {
    text-align: center;
    padding: 20px;
}

.welcome-screen h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--dark-color);
}

.welcome-screen p {
    margin-bottom: 30px;
    font-size: 1.1rem;
    color: #555;
}

.actions {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
}

/* Setup Screen */
.setup-screen h2 {
    margin-bottom: 20px;
}

.id-display {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    letter-spacing: 5px;
    margin: 20px 0;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

/* Recovery Phrase */
.recovery-phrase {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 25px 0;
}

.phrase-word {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    border: 1px solid #ddd;
}

.phrase-word span {
    font-weight: bold;
    color: #666;
    margin-right: 5px;
}

/* Chat Screen */
.chat-container {
    display: flex;
    height: 80vh;
    margin-top: 20px;
}

.contact-list {
    width: 30%;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.contact {
    padding: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.3s;
}

.contact:hover {
    background: #f9f9f9;
}

.contact.active-contact {
    background: #e8f0fe;
    border-left: 3px solid var(--primary-color);
}

.contact-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.contact-preview {
    font-size: 0.9rem;
    color: #777;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-box {
    width: 70%;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-left: 20px;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.message {
    padding: 10px 15px;
    border-radius: 15px;
    margin-bottom: 10px;
    max-width: 70%;
    word-break: break-word;
}

.received {
    background: #f1f0f0;
    align-self: flex-start;
}

.sent {
    background: var(--primary-color);
    color: white;
    align-self: flex-end;
    margin-left: auto;
}

.message-time {
    font-size: 0.7rem;
    text-align: right;
    margin-top: 5px;
    opacity: 0.7;
}

.chat-input {
    display: flex;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.chat-input input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 25px;
    margin-right: 10px;
}

/* Recovery Screen */
.recovery-input {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 25px 0;
}

.word-input {
    margin-bottom: 10px;
}

.word-input label {
    display: block;
    margin-bottom: 5px;
    color: #666;
}

.word-input input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Utility classes */
.hidden {
    display: none;
}

.alert {
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

footer {
    text-align: center;
    padding: 20px 0;
    color: #666;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .chat-container {
        flex-direction: column;
        height: auto;
    }
    
    .contact-list, .chat-box {
        width: 100%;
        margin-left: 0;
        margin-bottom: 20px;
    }
    
    .recovery-phrase, .recovery-input {
        grid-template-columns: repeat(2, 1fr);
    }
}