/* ============================================
   تعريف الخطوط
   ============================================ */
@font-face {
    font-family: 'Raqib';
    src: url('assets/fonts/Raqib.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ============================================
   متغيرات اللون - نظام منسجم وجميل
   ============================================ */
:root {
    /* الألوان الأساسية */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-lighter: #c7d2fe;
    --primary-dark: #4f46e5;
    
    /* ألوان ثانوية */
    --secondary: #8b5cf6;
    --secondary-light: #a78bfa;
    
    /* ألوان النجاح والتحذير والخطأ */
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    
    /* درجات الرمادي */
    --dark: #1f2937;
    --dark-light: #374151;
    --gray: #6b7280;
    --gray-light: #e5e7eb;
    --light: #f9fafb;
    --white: #ffffff;
    
    /* ظلال */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    
    /* انتقالات سلسة */
    --transition-fast: 0.15s ease-in-out;
    --transition: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;
}

/* ============================================
   إعادة تعيين وأساسيات
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
    /* منع التكبير في جميع حقول الإدخال */
    touch-action: manipulation;
}

body {
    font-family: 'Raqib', 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    background-attachment: fixed;
    color: var(--dark);
    line-height: 1.6;
    padding-bottom: 80px;
    min-height: 100vh;
}

/* ============================================
   حاوية رئيسية
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.main-content {
    padding: 20px 0;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   رأس القسم
   ============================================ */
.section-header {
    margin-bottom: 2rem;
    text-align: center;
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    letter-spacing: -0.5px;
}

.section-title i {
    font-size: 2.2rem;
}

/* ============================================
   البطاقات
   ============================================ */
.settings-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(99, 102, 241, 0.1);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    margin-bottom: 2rem;
    animation: slideUp 0.5s ease-out;
    transition: all var(--transition);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings-card:hover {
    box-shadow: var(--shadow-xl);
    border-color: rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.card-info {
    flex: 1;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--gray);
}

.form-content {
    padding: 1.5rem;
}

/* ============================================
   النماذج
   ============================================ */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-label i {
    color: var(--primary);
    font-size: 0.9rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1.5px solid var(--gray-light);
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all var(--transition);
    background: var(--white);
    color: var(--dark);
    /* منع التقريب والتكبير */
    transform: none !important;
    zoom: 1 !important;
    /* منع التحريك الأفقي */
    overflow-x: hidden;
    /* منع التكبير عند التركيز */
    transform-origin: center !important;
}

.form-input::placeholder {
    color: #d1d5db;
}

.form-input:hover {
    border-color: var(--primary-lighter);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.05);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    /* منع التكبير عند التركيز */
    transform: none !important;
    zoom: 1 !important;
}

.input-icon-left {
    position: absolute;
    left: 0.75rem;
    color: var(--gray);
    font-size: 0.9rem;
    pointer-events: none;
}

.toggle-password {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray);
    font-size: 1rem;
    padding: 0.5rem;
    display: none; /* إخفاء الزر */
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.toggle-password:hover {
    color: var(--primary);
}

.form-hint {
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: 0.5rem;
}

.form-hint a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition);
}

.form-hint a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ============================================
   الأزرار
   ============================================ */
.form-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    white-space: nowrap;
}

.btn i {
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    color: var(--dark);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #d1d5db 0%, #bfdbfe 100%);
    transform: translateY(-2px);
}

.btn-logout {
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
    color: #7f1d1d;
}

.btn-logout:hover {
    background: linear-gradient(135deg, #fca5a5 0%, #f87171 100%);
    transform: translateY(-2px);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* ============================================
   خيارات التتبع
   ============================================ */
.tracking-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-radius: 15px;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.tracking-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tracking-title i {
    color: var(--primary);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.option-card {
    padding: 1.25rem;
    border: 2px solid var(--gray-light);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--white);
}

.option-card:hover {
    border-color: var(--primary-lighter);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    transform: translateY(-2px);
}

.option-card.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.option-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 0.75rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all var(--transition);
}

.location-icon {
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
    color: #7f1d1d;
}

.device-icon {
    background: linear-gradient(135deg, #a5f3fc 0%, #67e8f9 100%);
    color: #164e63;
}

.ip-icon {
    background: linear-gradient(135deg, #c7d2fe 0%, #a5b4fc 100%);
    color: #3730a3;
}

.delay-icon {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #064e3b;
}

.option-title {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.option-description {
    font-size: 0.8rem;
    color: var(--gray);
}

/* ============================================
   الرابط المُنشأ
   ============================================ */
.generated-link-container {
    margin-bottom: 2rem;
    animation: slideUp 0.5s ease-out;
}

.generated-link-container.hidden {
    display: none;
}

.success-header {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(52, 211, 153, 0.1) 100%);
    border-bottom-color: var(--success-light);
}

.success-icon {
    background: linear-gradient(135deg, var(--success) 0%, #34d399 100%);
}

.link-display {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-light);
}

.link-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--gray-light);
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    background: var(--light);
    color: var(--dark);
    word-break: break-all;
    /* منع التقريب والتكبير */
    transform: none !important;
    zoom: 1 !important;
    /* منع التحريك الأفقي */
    overflow-x: hidden;
    /* منع التكبير عند التركيز */
    transform-origin: center !important;
}

.link-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.link-action-btn {
    flex: 1;
    min-width: 120px;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--gray-light);
    border-radius: 10px;
    background: var(--white);
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.link-action-btn.copy {
    border-color: var(--primary);
    color: var(--primary);
}

.link-action-btn.copy:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
}

.link-action-btn.test {
    border-color: var(--warning);
    color: var(--warning);
}

.link-action-btn.test:hover {
    background: var(--warning);
    color: var(--white);
    transform: translateY(-2px);
}

.link-action-btn.share {
    border-color: var(--success);
    color: var(--success);
}

.link-action-btn.share:hover {
    background: var(--success);
    color: var(--white);
    transform: translateY(-2px);
}

.link-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
}

.link-stat {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--light);
    border-radius: 10px;
}

.link-stat i {
    color: var(--primary);
    font-size: 1.1rem;
}

.link-stat span {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.95rem;
}

/* ============================================
   قائمة الروابط
   ============================================ */
.links-list {
    padding: 1.5rem;
}

.link-item {
    padding: 1.25rem;
    border: 1.5px solid var(--gray-light);
    border-radius: 12px;
    margin-bottom: 1rem;
    background: var(--white);
    transition: all var(--transition);
}

.link-item:hover {
    border-color: var(--primary-lighter);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.link-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.link-name {
    font-weight: 600;
    color: var(--dark);
    font-size: 1rem;
}

.link-date {
    font-size: 0.8rem;
    color: var(--gray);
    background: var(--light);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
}

.link-target {
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 0.75rem;
    word-break: break-all;
}

.link-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.link-option {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 500;
}

/* ============================================
   حالة فارغة
   ============================================ */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--gray);
}

.empty-state i {
    font-size: 3rem;
    color: var(--primary-lighter);
    margin-bottom: 1rem;
    display: block;
}

.empty-state p {
    font-size: 0.95rem;
}

/* ============================================
   التذييل
   ============================================ */
.main-footer {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 100%);
    color: #d1d5db;
    padding: 3rem 0 1rem;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section {
    padding: 0 1rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.25rem;
}

.footer-logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-subtitle {
    font-size: 0.9rem;
    color: #9ca3af;
    margin-bottom: 1.5rem;
}

.developer-section {
    border-top: 1px solid rgba(99, 102, 241, 0.1);
    padding-top: 1rem;
}

.developer-title {
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.developer-name {
    font-weight: 600;
    color: var(--primary-light);
}

.footer-heading {
    font-size: 0.9rem;
    color: var(--white);
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-list {
    list-style: none;
}

.footer-list li {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-list i {
    color: var(--success);
    font-size: 0.8rem;
}

.footer-list a {
    color: #d1d5db;
    text-decoration: none;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-list a:hover {
    color: var(--primary-light);
    transform: translateX(-2px);
}

.footer-social-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-social-link {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all var(--transition);
    font-size: 1.1rem;
}

.footer-social-link:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    transform: translateY(-2px);
}

.footer-copyright {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    text-align: center;
    color: #9ca3af;
    font-size: 0.85rem;
}

.footer-copyright p {
    margin: 0.25rem 0;
}

/* ============================================
   رسائل النظام
   ============================================ */
.message-box {
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    animation: slideDown 0.3s ease-out;
}

.message-success {
    background: linear-gradient(135deg, var(--success-light) 0%, #d1fae5 100%);
    color: #064e3b;
    border: 1px solid var(--success);
}

.message-error {
    background: linear-gradient(135deg, var(--danger-light) 0%, #fecaca 100%);
    color: #7f1d1d;
    border: 1px solid var(--danger);
}

.message-info {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    color: var(--dark);
    border: 1px solid var(--primary-lighter);
}

/* ============================================
   modal
   ============================================ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease-out;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 20px;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease-out;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray);
    cursor: pointer;
    transition: all var(--transition);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--gray-light);
    color: var(--dark);
}

.modal-body {
    padding: 1.5rem;
}

.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--gray-light);
}

.tab {
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--gray);
    transition: all var(--transition);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab:hover {
    color: var(--primary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.tab-content.active {
    display: block;
}

/* ============================================
   الأشكال الزخرفية
   ============================================ */
.decorative-shape {
    position: fixed;
    border-radius: 50%;
    opacity: 0.05;
    pointer-events: none;
    z-index: 0;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    top: -100px;
    right: -100px;
    animation: float 6s ease-in-out infinite;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    bottom: -50px;
    left: -50px;
    animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(30px);
    }
}

/* ============================================
   الاستجابة
   ============================================ */
@media (max-width: 768px) {
    .section-title {
        font-size: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.25rem;
    }
    
    .card-header {
        flex-direction: column;
        text-align: center;
    }
    
    .link-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .link-actions {
        flex-direction: column;
    }
    
    .link-action-btn {
        width: 100%;
    }
}
