/* نظام انتخابات الجالية اليمنية - الأنماط */

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

:root {
    --ye-primary: #CE1126;
    --ye-secondary: #FFFFFF;
    --ye-dark: #000000;
    --ye-success: #10b981;
    --ye-error: #ef4444;
    --ye-warning: #f59e0b;
    --ye-info: #3b82f6;
    --ye-border: #e5e7eb;
    --ye-bg: #f9fafb;
    --ye-text: #1f2937;
    --ye-text-light: #6b7280;
    --ye-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --ye-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --ye-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --ye-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* إعدادات عامة */
.yemen-election-container {
    font-family: 'Cairo', 'Inter', sans-serif;
    direction: rtl;
    text-align: right;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    line-height: 1.6;
}

/* دعم اللغة الإنجليزية */
.yemen-election-container[dir="ltr"] {
    direction: ltr;
    text-align: left;
    font-family: 'Inter', 'Cairo', sans-serif;
}

* {
    box-sizing: border-box;
}

.ye-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--ye-shadow);
    border: 1px solid var(--ye-border);
    transition: all 0.3s ease;
}

.ye-card:hover {
    box-shadow: var(--ye-shadow-md);
}

.ye-card-header {
    border-bottom: 3px solid var(--ye-primary);
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.ye-card-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--ye-text);
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.ye-card-description {
    font-size: 16px;
    color: var(--ye-text-light);
    margin: 0;
    line-height: 1.5;
}

/* النماذج */
.ye-form {
    width: 100%;
}

.ye-form-group {
    margin-bottom: 24px;
}

.ye-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--ye-text);
    font-size: 15px;
}

.ye-input,
.ye-textarea,
.ye-select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--ye-border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    color: var(--ye-text);
}

.ye-input:focus,
.ye-textarea:focus,
.ye-select:focus {
    outline: none;
    border-color: var(--ye-primary);
    box-shadow: 0 0 0 4px rgba(206, 17, 38, 0.1);
}

.ye-input::placeholder,
.ye-textarea::placeholder {
    color: #9ca3af;
}

.ye-textarea {
    min-height: 150px;
    resize: vertical;
    line-height: 1.6;
}

.ye-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: left 12px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-left: 40px;
}

[dir="ltr"] .ye-select {
    background-position: right 12px center;
    padding-left: 16px;
    padding-right: 40px;
}

/* الأزرار */
.ye-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.ye-btn-primary {
    background: linear-gradient(135deg, var(--ye-primary) 0%, #a00e1f 100%);
    color: white;
    box-shadow: var(--ye-shadow);
}

.ye-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--ye-shadow-lg);
}

.ye-btn-primary:active {
    transform: translateY(0);
}

.ye-btn-secondary {
    background: white;
    color: var(--ye-text);
    border: 2px solid var(--ye-border);
}

.ye-btn-secondary:hover {
    background: var(--ye-bg);
    border-color: var(--ye-primary);
}

.ye-btn-success {
    background: linear-gradient(135deg, var(--ye-success) 0%, #059669 100%);
    color: white;
    box-shadow: var(--ye-shadow);
}

.ye-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: var(--ye-shadow-lg);
}

.ye-btn-danger {
    background: linear-gradient(135deg, var(--ye-error) 0%, #dc2626 100%);
    color: white;
    box-shadow: var(--ye-shadow);
}

.ye-btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: var(--ye-shadow-lg);
}

.ye-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.ye-btn-full {
    width: 100%;
}

/* الإشعارات */
.ye-notice {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    align-items: start;
    gap: 12px;
    font-size: 15px;
    line-height: 1.6;
    animation: slideDown 0.3s ease;
}

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

.ye-notice-success {
    background: #d1fae5;
    color: #065f46;
    border: 2px solid #6ee7b7;
}

.ye-notice-error {
    background: #fee2e2;
    color: #991b1b;
    border: 2px solid #fca5a5;
}

.ye-notice-warning {
    background: #fef3c7;
    color: #92400e;
    border: 2px solid #fcd34d;
}

.ye-notice-info {
    background: #dbeafe;
    color: #1e40af;
    border: 2px solid #93c5fd;
}

/* الإحصائيات */
.ye-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.ye-stat-card {
    background: linear-gradient(135deg, var(--ye-primary) 0%, #a00e1f 100%);
    color: white;
    padding: 28px;
    border-radius: 16px;
    box-shadow: var(--ye-shadow-md);
    transition: all 0.3s ease;
}

.ye-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ye-shadow-lg);
}

.ye-stat-label {
    font-size: 15px;
    opacity: 0.95;
    margin-bottom: 12px;
    font-weight: 500;
}

.ye-stat-value {
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
}

/* المرشحون */
.ye-candidates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.ye-candidate-card {
    background: white;
    border: 2px solid var(--ye-border);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.ye-candidate-card:hover {
    border-color: var(--ye-primary);
    transform: translateY(-4px);
    box-shadow: var(--ye-shadow-lg);
}

.ye-candidate-card.selected {
    border-color: var(--ye-primary);
    background: rgba(206, 17, 38, 0.05);
    box-shadow: var(--ye-shadow-md);
}

.ye-candidate-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--ye-text);
    margin: 0;
    line-height: 1.3;
}

.ye-candidate-program {
    font-size: 15px;
    color: var(--ye-text-light);
    line-height: 1.7;
    margin: 0;
}

/* الشارات */
.ye-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
}

.ye-badge-president {
    background: #fef3c7;
    color: #92400e;
}

.ye-badge-member {
    background: #dbeafe;
    color: #1e40af;
}

.ye-badge-oversight {
    background: #d1fae5;
    color: #065f46;
}

/* النتائج */
.ye-results-position {
    margin-bottom: 40px;
}

.ye-result-item {
    background: white;
    border: 2px solid var(--ye-border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.ye-result-item:hover {
    box-shadow: var(--ye-shadow-md);
}

.ye-result-item.winner {
    border-color: var(--ye-success);
    background: rgba(16, 185, 129, 0.05);
    box-shadow: var(--ye-shadow);
}

.ye-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 16px;
}

.ye-result-rank {
    font-size: 36px;
    font-weight: 700;
    color: var(--ye-text-light);
    min-width: 50px;
    text-align: center;
}

.ye-result-rank.winner {
    color: var(--ye-success);
}

.ye-result-votes {
    text-align: left;
}

[dir="ltr"] .ye-result-votes {
    text-align: right;
}

.ye-result-votes-count {
    font-size: 32px;
    font-weight: 700;
    color: var(--ye-text);
    line-height: 1;
}

.ye-progress-bar {
    width: 100%;
    height: 14px;
    background: var(--ye-bg);
    border-radius: 7px;
    overflow: hidden;
    margin-top: 16px;
}

.ye-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ye-primary) 0%, #a00e1f 100%);
    transition: width 0.5s ease;
    border-radius: 7px;
}

.ye-progress-fill.winner {
    background: linear-gradient(90deg, var(--ye-success) 0%, #059669 100%);
}

/* Checkbox مخصص */
.ye-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.ye-checkbox input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--ye-primary);
}

/* التحميل */
.ye-loading {
    text-align: center;
    padding: 60px 20px;
}

.ye-spinner {
    border: 4px solid var(--ye-bg);
    border-top: 4px solid var(--ye-primary);
    border-radius: 50%;
    width: 56px;
    height: 56px;
    animation: ye-spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes ye-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* جدول الأعضاء */
.ye-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--ye-shadow);
}

.ye-table th,
.ye-table td {
    padding: 16px;
    text-align: right;
    border-bottom: 1px solid var(--ye-border);
}

[dir="ltr"] .ye-table th,
[dir="ltr"] .ye-table td {
    text-align: left;
}

.ye-table th {
    background: var(--ye-bg);
    font-weight: 700;
    color: var(--ye-text);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ye-table tr:hover {
    background: var(--ye-bg);
}

.ye-table tr:last-child td {
    border-bottom: none;
}

/* التبويبات */
.ye-tabs {
    border-bottom: 2px solid var(--ye-border);
    margin-bottom: 24px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.ye-tab {
    display: inline-block;
    padding: 14px 24px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s ease;
    font-weight: 600;
    white-space: nowrap;
    color: var(--ye-text-light);
}

.ye-tab:hover {
    background: var(--ye-bg);
    color: var(--ye-text);
}

.ye-tab.active {
    border-bottom-color: var(--ye-primary);
    color: var(--ye-primary);
}

.ye-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.ye-tab-content.active {
    display: block;
}

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

/* Responsive - الشاشات الصغيرة */
@media (max-width: 768px) {
    .yemen-election-container {
        padding: 16px;
    }
    
    .ye-card {
        padding: 20px;
        border-radius: 12px;
        margin-bottom: 20px;
    }
    
    .ye-card-title {
        font-size: 22px;
    }
    
    .ye-card-description {
        font-size: 14px;
    }
    
    .ye-stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .ye-stat-card {
        padding: 20px;
    }
    
    .ye-stat-value {
        font-size: 36px;
    }
    
    .ye-candidates-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .ye-candidate-card {
        padding: 20px;
    }
    
    .ye-result-header {
        flex-direction: column;
        align-items: start;
    }
    
    .ye-result-votes {
        text-align: right;
        width: 100%;
    }
    
    [dir="ltr"] .ye-result-votes {
        text-align: left;
    }
    
    .ye-btn {
        padding: 12px 20px;
        font-size: 15px;
    }
    
    .ye-table {
        font-size: 14px;
    }
    
    .ye-table th,
    .ye-table td {
        padding: 12px 8px;
    }
    
    /* جعل الجدول قابل للتمرير */
    .ye-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .ye-tabs {
        gap: 4px;
    }
    
    .ye-tab {
        padding: 12px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .ye-card-title {
        font-size: 20px;
    }
    
    .ye-stat-value {
        font-size: 32px;
    }
    
    .ye-result-votes-count {
        font-size: 28px;
    }
    
    .ye-result-rank {
        font-size: 28px;
    }
}

/* طباعة */
@media print {
    .ye-btn,
    .ye-tabs,
    .ye-card-description {
        display: none;
    }
    
    .ye-card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}

/* تحسينات إضافية */
.ye-form-group small {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--ye-text-light);
}

.ye-divider {
    height: 1px;
    background: var(--ye-border);
    margin: 24px 0;
}

.ye-text-center {
    text-align: center;
}

.ye-text-muted {
    color: var(--ye-text-light);
}

.ye-mt-4 {
    margin-top: 24px;
}

.ye-mb-4 {
    margin-bottom: 24px;
}

/* تحسين التباين للوصولية */
@media (prefers-contrast: high) {
    .ye-card {
        border-width: 2px;
    }
    
    .ye-btn {
        border: 2px solid currentColor;
    }
}

/* وضع الظلام (اختياري) */
@media (prefers-color-scheme: dark) {
    :root {
        --ye-bg: #1f2937;
        --ye-text: #f9fafb;
        --ye-text-light: #d1d5db;
        --ye-border: #374151;
    }
    
    .ye-card {
        background: #111827;
    }
    
    .ye-input,
    .ye-textarea,
    .ye-select {
        background: #1f2937;
        color: #f9fafb;
        border-color: #374151;
    }
}




/* شريط التنقل */
.ye-navigation {
    background: linear-gradient(135deg, #CE1126 0%, #a00e1f 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 999;
    margin: -20px -20px 30px -20px;
    width: calc(100% + 40px);
}

/* لu0644u0635u0641u062du0627u062a بu062fu0648u0646 وu064au062fu062cu0627u062a */
body:not(.wp-admin) .ye-navigation {
    margin: 0 0 30px 0;
    width: 100%;
}

/* تu062cu0627u0648u0628 مu0639 وu064au062fu062cu0627u062a وu0648u0631u062fu0628u0631u064au0633 */
.widget-area + * .ye-navigation,
.sidebar + * .ye-navigation {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
}

.ye-nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 65px;
}

.ye-nav-brand {
    flex-shrink: 0;
}

.ye-logo {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.ye-brand-text {
    color: white;
    font-size: 20px;
    font-weight: 700;
    white-space: nowrap;
}

.ye-nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.ye-nav-toggle span {
    width: 28px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.ye-nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.ye-nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.ye-nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.ye-nav-menu {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.ye-nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.25s ease;
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
}

.ye-nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.ye-nav-link.active {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    font-weight: 600;
}

.ye-nav-link svg {
    flex-shrink: 0;
}

.ye-nav-link-primary {
    background: rgba(255, 255, 255, 0.2);
}

.ye-nav-link-primary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ye-nav-link-success {
    background: rgba(16, 185, 129, 0.9);
}

.ye-nav-link-success:hover {
    background: rgba(16, 185, 129, 1);
}

.ye-nav-user {
    background: rgba(255, 255, 255, 0.12);
    padding: 8px 12px;
    border-radius: 10px;
    margin-right: 8px;
}

.ye-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ye-user-avatar {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

.ye-user-details {
    color: white;
}

.ye-user-name {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
}

.ye-user-id {
    font-size: 11px;
    opacity: 0.8;
}

/* Responsive - شاشات كبيرة */
@media (min-width: 1200px) {
    .ye-nav-link {
        padding: 9px 14px;
        font-size: 14.5px;
        gap: 7px;
    }
    
    .ye-nav-menu {
        gap: 8px;
    }
    
    .ye-user-avatar {
        width: 40px;
        height: 40px;
    }
    
    .ye-user-name {
        font-size: 14px;
    }
}

/* Responsive - الموبايل */
@media (max-width: 992px) {
    .ye-nav-toggle {
        display: flex;
    }
    
    .ye-nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 280px;
        height: calc(100vh - 70px);
        background: linear-gradient(180deg, #CE1126 0%, #a00e1f 100%);
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 20px;
        transition: left 0.3s ease;
        overflow-y: auto;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }
    
    .ye-nav-menu.active {
        left: 0;
    }
    
    .ye-nav-link {
        justify-content: flex-start;
        padding: 14px 16px;
    }
    
    .ye-nav-user {
        margin-right: 0;
        margin-top: 12px;
    }
    
    .ye-brand-text {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .ye-brand-text {
        display: none;
    }
    
    .ye-nav-container {
        padding: 0 12px;
    }
}

