/* ============================================
   Emergency Messenger PWA - Windows 7 Theme
   Mobile Optimized
   ============================================ */

:root {
    --win-blue: #0078d7;
    --win-dark: #005a9e;
    --win-light: #00bcf2;
    --win-gray: #f0f0f0;
    --win-border: #d9d9d9;
    --win-shadow: #00000020;
    --win-success: #107c10;
    --win-danger: #e81123;
    --win-warning: #ff8c00;
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: #000;
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
}

/* Windows 7 Window Style */
.window {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--win-border);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.5) inset;
    margin: 10px;
    overflow: hidden;
}

.window-header {
    background: linear-gradient(to bottom, #0078d7, #005a9e);
    color: white;
    padding: 12px 15px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--win-border);
}

.window-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.window-controls {
    display: flex;
    gap: 8px;
}

.control-btn {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
}

.control-btn.close {
    background: var(--win-danger);
}

.window-content {
    padding: 15px;
}

/* Cards */
.card {
    background: white;
    border: 1px solid var(--win-border);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--win-blue);
}

.card-icon {
    width: 40px;
    height: 40px;
    background: var(--win-blue);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--win-blue);
}

/* Form Elements */
input, textarea, select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--win-border);
    border-radius: 4px;
    background: white;
    color: #000;
    font-size: 15px;
    margin-bottom: 14px;
    transition: all 0.3s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--win-blue);
    box-shadow: 0 0 0 3px rgba(0, 120, 215, 0.2);
}

button {
    width: 100%;
    padding: 14px 16px;
    background: var(--win-blue);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

button:hover {
    background: var(--win-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

button:active {
    transform: translateY(0);
}

button.btn-danger {
    background: var(--win-danger);
}

button.btn-success {
    background: var(--win-success);
}

button.btn-ghost {
    background: transparent;
    border: 2px solid var(--win-blue);
    color: var(--win-blue);
}

/* Ad Banner */
.ad-banner {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    border: 2px solid var(--win-border);
    border-radius: 8px;
    margin: 15px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.ad-banner::before {
    content: 'ADVERTISEMENT';
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.3);
    color: white;
    padding: 4px 8px;
    font-size: 10px;
    border-radius: 4px;
}

.ad-content {
    color: white;
    font-weight: 600;
}

.ad-title {
    font-size: 22px;
    margin-bottom: 8px;
}

.ad-description {
    font-size: 16px;
    opacity: 0.9;
}

/* Messages */
.message {
    background: #f5f5f5;
    border-left: 4px solid var(--win-blue);
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.message-emergency {
    background: #fff3cd;
    border-left: 4px solid var(--win-danger);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    color: #666;
}

.message-badge {
    background: var(--win-danger);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.message-text {
    font-size: 14px;
    line-height: 1.5;
}

/* Navigation */
.navbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 2px solid var(--win-blue);
    padding: 8px 10px;
    display: flex;
    justify-content: space-around;
    z-index: 1000;
}

.nav-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    color: #666;
    text-decoration: none;
    font-size: 12px;
    border-radius: 4px;
    transition: all 0.3s;
}

.nav-item.active {
    background: var(--win-blue);
    color: white;
}

.nav-item:hover {
    background: var(--win-gray);
}

.nav-icon {
    font-size: 20px;
}

/* Alert Messages */
.alert {
    padding: 14px 16px;
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    border-color: var(--win-success);
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border-color: var(--win-danger);
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border-color: var(--win-warning);
    color: #856404;
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.grid-2 {
    grid-template-columns: 1fr 1fr;
}

@media (min-width: 768px) {
    .grid {
        grid-template-columns: 2fr 1fr;
    }
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: var(--win-blue);
    color: white;
    padding: 10px;
    font-weight: 600;
    text-align: left;
}

.table td {
    padding: 10px;
    border-bottom: 1px solid var(--win-border);
}

/* QR Code Display */
.qr-display {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #e0f2ff, #f0f8ff);
    border: 2px solid var(--win-light);
    border-radius: 8px;
    margin: 15px 0;
}

.qr-image {
    width: 200px;
    height: 200px;
    border: 3px solid var(--win-blue);
    border-radius: 8px;
    margin: 15px 0;
}

.qr-code-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--win-blue);
    margin: 10px 0;
    letter-spacing: 2px;
    font-family: monospace;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .window {
        margin: 5px;
        border-radius: 6px;
    }
    
    .window-header {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .window-content {
        padding: 12px;
    }
    
    .card {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .ad-banner {
        width: 100%;
        max-width: 300px;
        height: 250px;
        margin: 10px auto;
    }
    
    button {
        padding: 12px 14px;
    }
    
    .navbar {
        padding: 6px 8px;
    }
    
    .nav-item {
        padding: 6px;
    }
}

/* Page Layout */
.page {
    padding-bottom: 70px;
}

.page-header {
    background: linear-gradient(to bottom, #0078d7, #005a9e);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--win-gray);
    border-top-color: var(--modal-bg, #000);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Hidden */
.hidden {
    display: none;
}

/* Flex */
.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gap {
    gap: 10px;
}

.mt {
    margin-top: 10px;
}

.mb {
    margin-bottom: 10px;
}

.text-center {
    text-align: center;
}