/*
 * Styles for Crypto Investment Fund Plugin
 * THEME: AI / Cyberpunk
 * @version 3.7 (Fixes Header and Logout Button Size)
 */

/* === 1. الهيكل العام والحاويات === */
.cif-dashboard,
.cif-form-container {
    font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
    background-color: #0a0a1a; /* خلفية داكنة جداً (أزرق ليلي) */
    color: #f0f0f0; /* لون خط فاتح (أبيض مائل للرمادي) */
    border: 1px solid #00aaff; /* إطار أزرق سيبراني ساطع */
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 0 25px rgba(0, 170, 255, 0.2); /* ظل ناعم أزرق */
    max-width: 900px;
    margin: 20px auto;
}

.cif-form-container {
    max-width: 500px;
}

/* === NEW: Header Row for User Name & Logout === */
.cif-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

/* === NEW: Logout Button Styling (Smaller and Less Obtrusive) === */
.cif-btn-logout {
    background-color: #d63638 !important; /* لون أحمر */
    padding: 8px 15px !important; /* تصغير حجم الزر */
    font-size: 0.8em !important; /* تصغير حجم الخط */
    margin-left: 10px;
    border: 1px solid #d63638 !important;
    box-shadow: none !important;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 4px;
    line-height: 1; /* ضبط ارتفاع السطر لتجنب التمدد */
    align-self: center; /* محاذاة في المنتصف عمودياً */
}
.cif-btn-logout:hover {
    background-color: #ff4d4d !important;
    border-color: #ff4d4d !important;
    box-shadow: 0 0 5px rgba(255, 77, 77, 0.5) !important;
}

/* === 2. تنسيق رسالة الإعلان === */
.cif-announcement-box {
    background-color: rgba(0, 170, 255, 0.1); 
    border: 1px solid #00aaff; 
    border-left: 4px solid #00f2ff; 
    color: #f0f0f0;
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 4px;
    font-size: 0.95em; 
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
}

.cif-announcement-box span.dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    margin-top: -2px; 
}

.cif-announcement-box p {
    margin: 0 0 10px 0;
}

.cif-announcement-box p:last-child {
    margin-bottom: 0;
}

/* === 3. صناديق العرض العلوية === */
.cif-overview-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 15px;
    margin-bottom: 25px;
}

.cif-balance-box {
    background: #1f2a40; 
    color: #ffffff;
    padding: 20px;
    border-radius: 5px;
    text-align: center;
    border: 1px solid #00aaff;
    box-shadow: inset 0 0 10px rgba(0, 170, 255, 0.3); 
    transition: all 0.3s ease;
}

.cif-balance-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 170, 255, 0.3);
}

.cif-balance-box h4 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    font-weight: normal;
    color: #f0f0f0;
    opacity: 0.8;
}

.cif-balance-box p {
    margin: 0;
    font-size: 2.2em; 
    font-weight: bold;
    color: #00f2ff; 
    text-shadow: 0 0 8px #00f2ff;
}

/* تخصيص صندوق الأرباح */
.cif-balance-box.cif-profit-box p {
    color: #00ffaa; /* أخضر نيون */
    text-shadow: 0 0 8px #00ffaa;
}

/* صندوق الصفقات */
.cif-balance-box.cif-deals-box p {
    color: #f0f0f0; 
    text-shadow: none;
    font-size: 1.8em;
}


/* === 4. الأقسام والعناوين (تعديل ليتناسب مع الترحيب) === */
.cif-dashboard h3,
.cif-dashboard h4,
.cif-dashboard h5,
.cif-form-container h3,
.cif-form-container h4 {
    color: #ffffff;
    border-bottom: 1px solid #00aaff;
    padding-bottom: 10px;
    text-shadow: 0 0 5px #00aaff;
    margin-top: 0;
    margin-bottom: 15px;
}
.cif-dashboard h3 { /* تنسيق h3 كعنوان ترحيبي، لا خط سفلي */
    border-bottom: none;
    padding-bottom: 0;
    font-size: 1.5em;
    margin: 0;
}
.cif-dashboard h5 {
    font-size: 1.3em;
    border-bottom: none;
    text-shadow: none;
}

.cif-form-container h3 {
    text-align: center;
}

.cif-section {
    background-color: #1a1a2e; 
    border: 1px solid #4a4a5e; 
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 25px;
}

/* === 5. بطاقات الخطط === */
.cif-my-plans-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.cif-my-plan-item,
.cif-plan-box {
    background-color: #1f2a40;
    border: 1px solid #4a4a5e;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 15px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.cif-my-plan-item:hover,
.cif-plan-box:hover {
    border-color: #00aaff;
    box-shadow: 0 0 10px rgba(0, 170, 255, 0.3);
}

.cif-my-plan-item h5,
.cif-plan-box h5 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2em;
    color: #00f2ff; 
}

.cif-my-plan-item p,
.cif-plan-box p { 
    margin: 5px 0; 
    color: #ddd; 
}
.cif-my-plan-item small { color: #888; font-size: 0.9em; }

.cif-deals-value { 
    color: #00f2ff; 
    font-weight: bold; 
}

/* تنسيق صور الخطط */
.cif-plan-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.cif-plan-details-col {
    flex-grow: 1;
}

.cif-plan-image {
    max-width: 150px;
    height: auto;
    border-radius: 8px;
    border: 1px solid #00f2ff; 
    flex-shrink: 0;
}

/* === 6. الأزرار والنماذج === */
.cif-button {
    background-color: #00aaff;
    color: #0a0a1a; 
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.3s, box-shadow 0.3s;
    box-shadow: 0 0 8px rgba(0, 170, 255, 0.5);
    text-decoration: none;
    display: inline-block;
}
.cif-form-container input[type="submit"] {
    width: 100%;
    padding: 12px 20px;
}

.cif-button:hover,
.cif-form-container input[type="submit"]:hover {
    background-color: #00f2ff; 
    color: #0a0a1a;
    box-shadow: 0 0 15px #00f2ff;
}

.cif-dashboard label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #f0f0f0;
}

/* حقول الإدخال */
.cif-dashboard input[type="text"],
.cif-dashboard input[type="number"],
.cif-dashboard input[type="email"],
.cif-dashboard input[type="password"],
.cif-dashboard input[type="file"],
.cif-dashboard select,
.cif-dashboard textarea,
.cif-form-container input[type="text"],
.cif-form-container input[type="email"],
.cif-form-container input[type="password"],
.cif-form-container select.cif-select-input {
    background-color: #0a0a1a;
    color: #f0f0f0;
    border: 1px solid #4a4a5e;
    padding: 12px;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.cif-dashboard textarea {
    min-height: 120px;
    font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
}

.cif-dashboard input[type="text"]:focus,
.cif-dashboard input[type="number"]:focus,
.cif-dashboard input[type="email"]:focus,
.cif-dashboard input[type="password"]:focus,
.cif-dashboard input[type="file"]:focus,
.cif-dashboard select:focus,
.cif-dashboard textarea:focus,
.cif-form-container input[type="text"]:focus,
.cif-form-container input[type="email"]:focus,
.cif-form-container input[type="password"]:focus,
.cif-form-container select.cif-select-input:focus {
    border-color: #00f2ff;
    box-shadow: 0 0 5px rgba(0, 242, 255, 0.5);
    outline: none;
}

.cif-address-input {
    background-color: #111;
    color: #00f2ff;
    border: 1px solid #00f2ff;
    text-align: center;
    font-family: monospace;
    font-size: 1.1em;
}

/* تنسيق QR Code */
#cif-qrcode-display {
    margin: 15px auto;
    padding: 10px;
    background-color: #fff;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#cif-qrcode-display img,
#cif-qrcode-display canvas { 
    display: block; 
    margin: 0 auto;
}

/* === 7. الجداول والإشعارات (محسّن للموبايل) === */

/* تنسيق حاوية التمرير الجديدة */
.cif-table-scroll {
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch; 
    width: 100%;
    margin-bottom: 15px;
    border: 1px solid #4a4a5e;
    border-radius: 4px;
}

.cif-table { 
    width: 100%; 
    border-collapse: collapse; 
    min-width: 600px; 
    border: none;
}

.cif-table th, .cif-table td { 
    padding: 12px; 
    text-align: left; 
    border-bottom: 1px solid #4a4a5e; 
    word-break: normal; 
    white-space: nowrap; 
    font-size: 0.9em;
}

/* استثناء لعمود التفاصيل ليسمح له بالالتفاف */
.cif-table td:last-child {
    white-space: normal;
    min-width: 150px;
}

.cif-table th { 
    background-color: #1f2a40; 
    color: #00aaff; 
}
.cif-profit { color: #00ffaa; font-weight: bold; } 
.cif-loss { color: #ff4d4d; } 

.cif-notice { 
    background-color: #1f2a40; 
    border-left: 4px solid #00aaff; 
    padding: 15px; 
    color: #f0f0f0; 
    border-radius: 4px;
}

/* رسائل النجاح والخطأ */
.cif-success { 
    background-color: rgba(0, 255, 170, 0.1); 
    color: #00ffaa; 
    border: 1px solid #00ffaa; 
    padding: 15px; 
    border-radius: 4px; 
    margin-bottom: 20px; 
}
.cif-error { 
    background-color: rgba(255, 77, 77, 0.1); 
    color: #ff4d4d; 
    border: 1px solid #ff4d4d; 
    padding: 15px; 
    border-radius: 4px; 
    margin-bottom: 20px; 
}

/* === 8. شارات الحالة (Status Badges) === */
.cif-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: bold;
    text-transform: uppercase;
    color: #fff;
}
.cif-badge-open, .cif-badge-user-reply {
    background-color: #00aaff;
    color: #0a0a1a;
}
.cif-badge-answered {
    background-color: #00ffaa;
    color: #0a0a1a;
}
.cif-badge-closed {
    background-color: #4a4a5e;
}


/* === 9. تنسيقات تذاكر الدعم === */
.cif-conversation-wrap {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.cif-message-bubble {
    padding: 15px;
    border-radius: 8px;
    border: 1px solid;
    max-width: 85%;
}
.cif-message-bubble strong {
    color: #00f2ff;
    display: block;
    margin-bottom: 5px;
}
.cif-message-bubble small {
    font-size: 0.8em;
    opacity: 0.7;
}
.cif-message-content {
    margin-top: 10px;
}
.cif-message-content p {
    margin: 0;
    color: #f0f0f0;
}
.cif-message-bubble.user-reply {
    background-color: #1f2a40;
    border-color: #4a4a5e;
    align-self: flex-start;
}
.cif-message-bubble.admin-reply {
    background-color: #2a3a50;
    border-color: #00aaff;
    align-self: flex-end;
}
.cif-message-bubble.admin-reply strong {
    color: #00ffaa;
}


/* === 10. الاستجابة للشاشات الصغيرة (Media Queries) === */
@media (max-width: 800px) {
    .cif-overview-container {
        grid-template-columns: 1fr; /* عمود واحد فقط في الشاشات الأصغر */
    }
}

@media (max-width: 500px) {
    .cif-plan-header-row {
        flex-direction: column;
    }
    .cif-plan-image {
        max-width: 100%;
        margin-top: 15px;
    }
    .cif-message-bubble {
        max-width: 100%;
    }
}

/* === 11. تحسين العرض للموبايل === */
@media (max-width: 768px) {
    /* استهداف الحاوية الرئيسية للوحة التحكم */
    .cif-dashboard {
        padding: 10px !important;   /* تقليل الحشو الداخلي من 25 إلى 10 */
        margin: 5px auto !important; /* تقليل الهوامش الخارجية */
        width: 98% !important;      /* إجبار العرض ليأخذ 98% من الشاشة */
        max-width: 100% !important;
        box-sizing: border-box;     /* ضمان احتساب الحواف ضمن العرض */
        border-radius: 4px;         
    }

    /* تكبير النصوص قليلاً لتكون أوضح مع المساحة الجديدة */
    .cif-balance-box h4 {
        font-size: 0.9em; 
    }
    
    .cif-balance-box p {
        font-size: 1.8em; 
    }

    /* تقليل المسافات بين الصناديق */
    .cif-overview-container {
        gap: 10px !important;
    }
    
    /* جعل حقول الإدخال والأزرار تأخذ العرض الكامل بشكل مريح */
    .cif-dashboard input[type="text"],
    .cif-dashboard input[type="number"], 
    .cif-dashboard select, 
    .cif-button {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* جعل زر اللوغ آوت يأخذ العرض الكامل للموبايل */
    .cif-btn-logout {
        width: 100% !important;
        padding: 10px 15px !important;
    }
    
    /* تصغير حجم التبويبات لتتناسب مع الشاشة */
    .cif-tabs button {
        width: 50%; /* زرين في السطر */
        font-size: 13px;
        padding: 8px 10px;
    }
}
/* --- TABS STYLING --- */
.cif-tabs {
    overflow: hidden;
    border-bottom: 2px solid #00aaff;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.cif-tabs button {
    background-color: transparent;
    color: #f0f0f0;
    float: left;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 14px 16px;
    transition: 0.3s;
    font-size: 16px;
    font-weight: bold;
    flex-grow: 1; 
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}

.cif-tabs button:hover {
    background-color: rgba(0, 170, 255, 0.1);
    color: #00f2ff;
}

.cif-tabs button.active {
    background-color: #00aaff;
    color: #0a0a1a;
    box-shadow: 0 0 10px rgba(0, 170, 255, 0.5);
}

.cif-tab-content {
    display: none;
    animation: fadeEffect 0.5s;
}

@keyframes fadeEffect {
    from {opacity: 0;}
    to {opacity: 1;}
}

/* تعديل بسيط للصناديق داخل التبويبات */
.cif-tab-content .cif-section {
    border: none;
    background: transparent;
    padding: 0;
}
/* === تنسيق صندوق التنبيه الخاص === */
.cif-personal-alert-box {
    background-color: rgba(0, 0, 0, 0.3); /* خلفية داكنة شفافة */
    border: 1px solid; /* اللون سيتم تحديده عبر الستايل المضمن */
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 25px;
    font-weight: bold;
    font-size: 1.1em;
    text-align: center;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
    animation: fadeInAlert 0.5s ease-in-out;
}

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