/* RYA Color Scheme */
:root {
    --rya-navy: #002664;
    --rya-red: #D41C30;
    --rya-white: #FFFFFF;
    --rya-yellow: #FFD700;
    --rya-blue: #0066CC;
    --rya-light-blue: #E6F2FF;
    --rya-gray: #F5F5F5;
    --rya-dark-gray: #333333;
    --rya-green: #28A745;
    --rya-orange: #FF6B35;
    --rya-purple: #6F42C1;
    --rya-pink: #E83E8C;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--rya-gray);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    -webkit-tap-highlight-color: transparent;
}

.app-container {
    background: var(--rya-white);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    max-width: 500px;
    width: 100%;
    animation: slideUp 0.5s ease;
    border: 3px solid var(--rya-navy);
    height: 90vh;
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* RYA Header */
.rya-header {
    background: linear-gradient(135deg, var(--rya-navy) 0%, var(--rya-blue) 100%);
    color: var(--rya-white);
    padding: 20px;
    text-align: center;
    position: relative;
    border-bottom: 5px solid var(--rya-red);
    flex-shrink: 0;
}

.rya-logo {
    font-size: 36px;
    margin-bottom: 10px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.company-name {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.app-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--rya-yellow);
}

.tagline {
    font-size: 12px;
    opacity: 0.9;
    max-width: 400px;
    margin: 0 auto;
}

/* Main Content */
.main-content {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--rya-blue) var(--rya-light-blue);
}

.main-content::-webkit-scrollbar {
    width: 8px;
}

.main-content::-webkit-scrollbar-track {
    background: var(--rya-light-blue);
    border-radius: 4px;
}

.main-content::-webkit-scrollbar-thumb {
    background: var(--rya-blue);
    border-radius: 4px;
}

/* Screen Container */
.screen-container {
    display: block;
}

/* Status Card */
.status-card {
    background: var(--rya-light-blue);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
    border: 2px solid var(--rya-blue);
    position: relative;
    overflow: hidden;
}

.status-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: var(--rya-green);
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--rya-dark-gray);
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--rya-green);
    box-shadow: 0 0 10px var(--rya-green);
    animation: pulse 2s infinite;
}

/* RYA Section Cards */
.section-card {
    background: var(--rya-white);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid var(--rya-light-blue);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: var(--rya-navy);
    font-weight: 700;
    font-size: 18px;
    border-bottom: 2px solid var(--rya-light-blue);
    padding-bottom: 10px;
}

.section-title i {
    color: var(--rya-blue);
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--rya-dark-gray);
    font-size: 14px;
}

.form-label.required::after {
    content: " *";
    color: var(--rya-red);
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
    background: var(--rya-white);
}

.form-control:focus {
    outline: none;
    border-color: var(--rya-blue);
    box-shadow: 0 0 0 3px rgba(0,102,204,0.1);
}

.form-text {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    display: block;
}

/* Checkbox and Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    cursor: pointer;
}

.form-check-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-check-label {
    font-size: 14px;
    color: var(--rya-dark-gray);
    cursor: pointer;
}

/* Buttons */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin: 8px 0;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--rya-navy), var(--rya-blue));
    color: var(--rya-white);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--rya-blue), var(--rya-navy));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,38,100,0.2);
}

.btn-success {
    background: linear-gradient(135deg, var(--rya-green), #20c997);
    color: var(--rya-white);
}

.btn-danger {
    background: linear-gradient(135deg, var(--rya-red), #ff416c);
    color: var(--rya-white);
}

.btn-warning {
    background: linear-gradient(135deg, var(--rya-orange), #ff8e53);
    color: var(--rya-white);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: var(--rya-white);
}

.btn-purple {
    background: linear-gradient(135deg, var(--rya-purple), #8a63d2);
    color: var(--rya-white);
}

.btn-pink {
    background: linear-gradient(135deg, var(--rya-pink), #f783ac);
    color: var(--rya-white);
}

.btn-sm {
    padding: 8px 12px;
    font-size: 14px;
    width: auto;
    display: inline-flex;
}

/* Trip Info Display */
.trip-info {
    background: var(--rya-light-blue);
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
    border-left: 4px solid var(--rya-blue);
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: var(--rya-navy);
    font-size: 14px;
}

.info-value {
    color: var(--rya-dark-gray);
    font-size: 14px;
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}

/* Trip History Card */
.trip-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid var(--rya-light-blue);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s;
    cursor: pointer;
}

.trip-card:hover {
    border-color: var(--rya-blue);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.trip-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.trip-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active { background: var(--rya-green); color: white; }
.status-completed { background: var(--rya-blue); color: white; }
.status-overdue { background: var(--rya-red); color: white; }
.status-cancelled { background: #6c757d; color: white; }

.trip-card-details {
    font-size: 14px;
    color: var(--rya-dark-gray);
}

.trip-card-details div {
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Contacts List */
.contacts-list {
    max-height: 300px;
    overflow-y: auto;
    margin: 15px 0;
}

.contact-item {
    background: white;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    border: 2px solid #eee;
    transition: all 0.3s;
}

.contact-item:hover {
    border-color: var(--rya-blue);
}

.contact-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.contact-name {
    font-weight: 600;
    color: var(--rya-navy);
    font-size: 16px;
}

.contact-badges {
    display: flex;
    gap: 5px;
}

.contact-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

.badge-primary { background: var(--rya-blue); color: white; }
.badge-emergency { background: var(--rya-red); color: white; }
.badge-relationship { background: var(--rya-green); color: white; }

.contact-details {
    font-size: 14px;
    color: var(--rya-dark-gray);
}

.contact-details div {
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.contact-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    justify-content: flex-end;
}

/* Timer */
.timer-container {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(135deg, #fff5f5, #ffe5e5);
    border-radius: 12px;
    border: 2px solid var(--rya-red);
}

.timer-label {
    font-size: 14px;
    color: var(--rya-dark-gray);
    margin-bottom: 8px;
}

.timer-display {
    font-family: 'Courier New', monospace;
    font-size: 32px;
    font-weight: 800;
    color: var(--rya-red);
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timer-status {
    font-size: 12px;
    color: var(--rya-red);
    font-weight: 600;
    margin-top: 8px;
}

/* Overdue Alert */
.overdue-alert {
    background: linear-gradient(135deg, #ff0000, #ff6b6b);
    color: white;
    padding: 12px;
    border-radius: 10px;
    margin: 15px 0;
    text-align: center;
    animation: flash 1s infinite;
    border: 2px solid white;
}

@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* SOS Button */
.sos-container {
    text-align: center;
    margin: 25px 0;
}

.sos-button {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rya-red), #ff0000);
    color: var(--rya-white);
    border: none;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 auto 15px;
    box-shadow: 0 10px 30px rgba(255, 0, 0, 0.4);
    transition: all 0.3s;
    animation: pulse-red 2s infinite;
    position: relative;
    z-index: 1;
}

.sos-button:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 40px rgba(255, 0, 0, 0.6);
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(255, 0, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0); }
}

.sos-label {
    font-size: 11px;
    color: rgba(255,255,255,0.9);
}

/* Feature Grid for Main Menu */
.feature-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
}

.feature-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.feature-item {
    background: white;
    border: 2px solid var(--rya-light-blue);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
    height: 100%;
    min-height: 80px;
}

.feature-item:hover {
    border-color: var(--rya-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.feature-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--rya-blue), var(--rya-navy));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-icon i {
    font-size: 20px;
    color: white;
}

.feature-content {
    flex: 1;
    min-width: 0;
}

.feature-content h4 {
    margin: 0 0 4px 0;
    color: var(--rya-navy);
    font-size: 15px;
    line-height: 1.2;
}

.feature-content p {
    margin: 0;
    font-size: 11px;
    color: var(--rya-dark-gray);
    line-height: 1.2;
}

/* Footer */
.footer {
    text-align: center;
    padding: 15px;
    background: var(--rya-navy);
    color: var(--rya-white);
    font-size: 11px;
    border-top: 2px solid var(--rya-red);
    flex-shrink: 0;
}

.footer-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 10px;
    opacity: 0.8;
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--rya-green);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    z-index: 1000;
    animation: slideInRight 0.3s ease;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    max-width: 350px;
    border-left: 5px solid var(--rya-white);
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top-color: var(--rya-blue);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 20px;
    max-width: 450px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 3px solid var(--rya-navy);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--rya-light-blue);
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--rya-navy);
}

.modal-close {
    background: var(--rya-red);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--rya-light-blue);
    margin-bottom: 20px;
}

.tab {
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 600;
    color: var(--rya-dark-gray);
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab:hover {
    color: var(--rya-blue);
}

.tab.active {
    color: var(--rya-blue);
    border-bottom: 3px solid var(--rya-blue);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    border: 2px solid var(--rya-light-blue);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--rya-navy);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: var(--rya-dark-gray);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #ddd;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #999;
}

/* Messenger Styles */
.messenger-chat-container {
    height: 400px;
    overflow-y: auto;
    border: 2px solid var(--rya-light-blue);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    background: #fafafa;
}

.message {
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 80%;
    position: relative;
}

.message.sent {
    background: var(--rya-blue);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 5px;
}

.message.received {
    background: white;
    color: var(--rya-dark-gray);
    border: 1px solid #eee;
    border-bottom-left-radius: 5px;
}

.message-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 5px;
    opacity: 0.8;
}

.message-content {
    word-wrap: break-word;
}

.message-actions {
    display: flex;
    gap: 10px;
    margin-top: 5px;
    font-size: 12px;
}

/* Topics List */
.topics-list {
    max-height: 400px;
    overflow-y: auto;
}

.topic-item {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    border: 2px solid #eee;
    cursor: pointer;
    transition: all 0.3s;
}

.topic-item:hover {
    border-color: var(--rya-blue);
    transform: translateY(-2px);
}

.topic-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.topic-title {
    font-weight: 600;
    color: var(--rya-navy);
    font-size: 16px;
}

.topic-meta {
    font-size: 12px;
    color: #666;
}

.topic-preview {
    font-size: 14px;
    color: var(--rya-dark-gray);
    margin-bottom: 10px;
}

.topic-stats {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #666;
}

/* Knowledge Base */
.knowledge-categories {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.category-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    border: 2px solid var(--rya-light-blue);
    cursor: pointer;
    transition: all 0.3s;
}

.category-card:hover {
    border-color: var(--rya-blue);
    transform: translateY(-2px);
}

.category-icon {
    font-size: 32px;
    color: var(--rya-blue);
    margin-bottom: 10px;
}

.category-title {
    font-weight: 600;
    color: var(--rya-navy);
    margin-bottom: 5px;
}

.category-count {
    font-size: 12px;
    color: #666;
}

/* Responsive */
@media (max-width: 480px) {
    .app-container {
        border-radius: 15px;
        height: 95vh;
    }
    
    .rya-header {
        padding: 15px;
    }
    
    .company-name {
        font-size: 18px;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .timer-display {
        font-size: 28px;
    }
    
    .sos-button {
        width: 140px;
        height: 140px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .feature-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .feature-item {
        padding: 10px;
        min-height: 75px;
    }
    
    .feature-icon {
        width: 40px;
        height: 40px;
    }
    
    .feature-icon i {
        font-size: 18px;
    }
    
    .feature-content h4 {
        font-size: 13px;
        line-height: 1.3;
    }
    
    .feature-content p {
        font-size: 10px;
        line-height: 1.2;
    }
    
    .knowledge-categories {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none;
    }
}