:root {
    --primary-color: #9370DB; /* Medium Purple */
    --primary-dark: #663399; /* Rebecca Purple */
    --secondary-color: #E6E6FA; /* Lavender */
    --text-color: #333333;
    --white: #FFFFFF;
    --sos-color: #E57373; /* Soft Red */
    --sos-hover: #D32F2F;
    --gray-light: #f4f4f4;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --radius: 8px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--secondary-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 90%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.main-header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo h1 {
    color: var(--primary-dark);
    font-size: 1.5rem;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 1rem;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: var(--primary-color);
}

.language-selector select {
    padding: 0.5rem;
    border-radius: var(--radius);
    border: 1px solid #ccc;
    background-color: var(--white);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 0;
    background-color: var(--white);
    border-radius: var(--radius);
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.hero h2 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.hero-actions {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-outline {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background-color: var(--gray-light);
    color: var(--text-color);
}

.btn-emergency {
    background-color: var(--sos-color);
    color: var(--white);
}

/* Cards */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Safety Exit Button */
.safety-exit {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    background-color: #555;
    color: white;
    padding: 1rem;
    border: none;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    z-index: 1000;
    font-size: 0.9rem;
    box-shadow: -2px 2px 10px rgba(0,0,0,0.2);
    transition: right 0.3s;
}

.safety-exit:hover {
    padding-right: 1.5rem;
    background-color: #333;
}

.shortcut-hint {
    font-size: 0.7rem;
    opacity: 0.8;
    display: block;
    margin-top: 4px;
}

/* SOS Button */
.sos-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--sos-color);
    color: white;
    border: none;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(229, 115, 115, 0.4);
    z-index: 1000;
    animation: pulse 2s infinite;
}

.sos-button:hover {
    background-color: var(--sos-hover);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* SOS Overlay */
.sos-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.sos-overlay.hidden {
    display: none;
}

.sos-content {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    max-width: 90%;
    width: 400px;
    border: 2px solid var(--sos-color);
}

.sos-content h2 {
    color: var(--sos-color);
    margin-bottom: 1rem;
}

.sos-actions {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Chat Styles */
.chat-interface {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 500px;
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    background-color: #f9f9f9;
}

.message {
    margin-bottom: 1rem;
    max-width: 80%;
    padding: 0.8rem;
    border-radius: 1rem;
}

.message.bot {
    background-color: var(--secondary-color);
    color: var(--text-color);
    align-self: flex-start;
    border-bottom-left-radius: 0;
}

.message.user {
    background-color: var(--primary-color);
    color: var(--white);
    margin-left: auto;
    border-bottom-right-radius: 0;
}

.chat-input-area {
    padding: 1rem;
    border-top: 1px solid #eee;
    display: flex;
    gap: 0.5rem;
}

.chat-input-area input {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: var(--radius);
}

/* Directory Styles */
.directory-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.directory-item {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
}

.directory-item h3 {
    margin-bottom: 0.5rem;
}

.directory-item p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

/* Footer */
.main-footer {
    background-color: var(--white);
    padding: 1rem 0;
    text-align: center;
    margin-top: auto;
    font-size: 0.9rem;
    color: #777;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    .safety-exit {
        top: auto;
        bottom: 100px;
        right: 0;
        border-radius: 8px 0 0 8px;
    }
}
