@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;700&display=swap');

:root {
    --primary-red: #e74c3c;
    --dark-red: #c0392b;
    --soft-pink: #fadbd8;
    --white: #ffffff;
    --text-color: #333;
    --success-green: #2ecc71;
    --warning-yellow: #f1c40f;
    --danger-red: #e74c3c;
}

body {
    font-family: 'Tajawal', sans-serif;
    margin: 0;
    padding: 0;
    direction: rtl;
    text-align: center;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    justify-content: center;
    align-items: center;
    background: linear-gradient(-45deg, #ff9a9e, #fad0c4, #ffecd2, #fcb69f, #e74c3c);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    width: 90%;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.95);
    padding: 2.5rem;
    border-radius: 25px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

h1.greeting {
    color: var(--dark-red);
    font-size: 1.8rem;
    margin-bottom: 2rem;
    line-height: 1.6;
    font-weight: 700;
    min-height: 3.2rem;
    animation: fadeInMove 1s ease-out;
}

@keyframes fadeInMove {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.action-btn {
    background: linear-gradient(45deg, var(--primary-red), var(--dark-red));
    color: var(--white);
    border: none;
    padding: 15px 40px;
    font-size: 1.3rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 300px;
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
}

.action-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.6);
}

.action-btn:active {
    transform: translateY(1px);
}

.action-btn.stop-btn {
    background: linear-gradient(45deg, #34495e, #2c3e50);
    box-shadow: 0 4px 15px rgba(44, 62, 80, 0.4);
    margin-top: 15px;
}

.sub-text {
    margin-top: 1.5rem;
    font-size: 1rem;
    color: #666;
    line-height: 1.6;
}

/* Status Indicators */
.status-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    transition: all 0.3s;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: 8px;
    display: inline-block;
}

.status-active {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}
.status-active .status-dot {
    background-color: #2e7d32;
    box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.7);
    animation: pulse-green 2s infinite;
}

.status-offline {
    background-color: #fff3e0;
    color: #ef6c00;
    border: 1px solid #ffe0b2;
}
.status-offline .status-dot {
    background-color: #ef6c00;
}

.status-stopped {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}
.status-stopped .status-dot {
    background-color: #c62828;
}

@keyframes pulse-green {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(46, 125, 50, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 125, 50, 0); }
}

.timer-badge {
    background: #f8f9fa;
    padding: 8px 15px;
    border-radius: 50px;
    font-family: monospace;
    font-weight: bold;
    color: #555;
    border: 1px solid #eee;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Sharing Section */
.sharing-info {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px dashed #eee;
    display: none;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.link-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 1rem;
    word-break: break-all;
    font-family: monospace;
    font-size: 0.9rem;
    user-select: all;
    border: 1px solid #eee;
    color: var(--primary-red);
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.share-btn {
    padding: 10px 25px;
    border-radius: 25px;
    text-decoration: none;
    color: white;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s;
    font-family: 'Tajawal', sans-serif;
}

.share-btn:hover {
    transform: scale(1.05);
}

.whatsapp { background-color: #25D366; box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3); }
.telegram { background-color: #0088cc; box-shadow: 0 4px 10px rgba(0, 136, 204, 0.3); }

.copy-btn {
    background: #ecf0f1;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 5px;
    font-size: 0.9rem;
    color: #2c3e50;
    transition: background 0.2s;
    font-family: 'Tajawal', sans-serif;
}

.copy-btn:hover {
    background: #d5dbdb;
}

.follow-self-btn {
    display: block;
    margin: 15px auto 0;
    background: white;
    color: var(--primary-red);
    border: 2px solid var(--primary-red);
    padding: 10px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
    display: none;
}

.follow-self-btn:hover {
    background: var(--primary-red);
    color: white;
}

/* PWA Install Button */
.pwa-install-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background: white;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    font-family: 'Tajawal', sans-serif;
    font-weight: bold;
    color: var(--text-color);
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.3s;
    animation: bounceIn 1s;
}

.pwa-install-btn:hover {
    transform: scale(1.05);
}

@keyframes bounceIn {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); }
}

/* Map Page Styles */
#map {
    height: 100vh;
    width: 100%;
}

.track-container {
    width: 100%;
    height: 100vh;
    padding: 0;
    margin: 0;
    position: relative;
}

.track-info {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    z-index: 1000;
    width: 85%;
    max-width: 400px;
    text-align: center;
    backdrop-filter: blur(5px);
}

/* Tracking Modes */
.tracking-modes {
    margin: 20px 0;
    text-align: right;
}

.section-title {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--text-color);
}

.mode-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.mode-btn {
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 10px 15px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #555;
    flex: 1;
    min-width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.mode-btn:hover {
    background: #e9ecef;
}

.mode-btn.active {
    background: #e8f5e9;
    border-color: #2e7d32;
    color: #2e7d32;
    box-shadow: 0 2px 5px rgba(46, 125, 50, 0.1);
}

.mode-btn.active[data-mode="fast"] {
    background: #fff3e0;
    border-color: #ef6c00;
    color: #ef6c00;
}

.mode-btn.active[data-mode="save"] {
    background: #e3f2fd;
    border-color: #1976d2;
    color: #1976d2;
}

@media (max-width: 600px) {
    .container {
        width: 85%;
        padding: 2rem 1.5rem;
    }
    
    h1.greeting {
        font-size: 1.4rem;
    }
    
    .pwa-install-btn {
        top: auto;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        width: auto;
        box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    }
    
    .pwa-install-btn:hover {
        transform: translateX(-50%) scale(1.05);
    }
}
