/* Arabic Logic System - Frontend Styles */

/* Main Container */
.arabic-logic-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    line-height: 1.8;
    direction: rtl;
    font-family: 'Tahoma', 'Arial', sans-serif;
    color: #2c3e50;
}

/* Header Section */
.logic-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 3px solid #3498db;
    padding-bottom: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 30px 20px 20px;
    border-radius: 8px 8px 0 0;
    margin: -30px -30px 30px -30px;
}

.logic-title {
    color: #2c3e50;
    font-size: 32px;
    margin-bottom: 15px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.logic-technical-title {
    color: #34495e;
    font-size: 20px;
    font-weight: normal;
    margin: 0;
    opacity: 0.9;
}

/* Meta Information */
.logic-meta-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-right: 5px solid #3498db;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.logic-row {
    margin-bottom: 12px;
    font-size: 16px;
    display: flex;
    align-items: center;
}

.logic-row strong {
    color: #2980b9;
    margin-left: 10px;
    min-width: 100px;
}

/* Sections */
.logic-sections {
    margin: 30px 0;
}

.logic-section {
    margin-bottom: 35px;
    padding: 25px;
    background: #fdfdfd;
    border-radius: 8px;
    border-right: 4px solid #3498db;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.logic-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.section-title {
    color: #2980b9;
    font-size: 22px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
    font-weight: bold;
    position: relative;
}

.section-title::before {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 50px;
    height: 2px;
    background: #3498db;
}

.section-content {
    font-size: 16px;
    color: #2c3e50;
    line-height: 1.8;
}

/* Lists */
.logic-list {
    list-style: none;
    padding-right: 0;
    margin: 15px 0;
}

.logic-list li {
    padding: 12px 0 12px 30px;
    position: relative;
    border-bottom: 1px solid #f8f9fa;
    transition: background-color 0.2s ease;
}

.logic-list li:hover {
    background-color: #f8f9fa;
    border-radius: 4px;
}

.logic-list li:before {
    content: "●";
    color: #3498db;
    font-size: 18px;
    position: absolute;
    right: 0;
    top: 12px;
}

.logic-list li:last-child {
    border-bottom: none;
}

/* Code Block */
.code-block {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
    padding: 25px;
    border-radius: 8px;
    overflow-x: auto;
    direction: ltr;
    text-align: left;
    font-family: 'Courier New', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.6;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.2);
    border: 1px solid #34495e;
    position: relative;
}

.code-block::before {
    content: 'Python';
    position: absolute;
    top: 10px;
    left: 15px;
    background: #e74c3c;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
}

/* Hash Display */
.hash-display {
    background: linear-gradient(135deg, #ecf0f1 0%, #bdc3c7 100%);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-right: 5px solid #3498db;
    position: relative;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}

.hash-display code {
    font-family: 'Courier New', 'Monaco', monospace;
    font-size: 11px;
    word-break: break-all;
    color: #2c3e50;
    background: rgba(255,255,255,0.8);
    padding: 15px;
    border-radius: 4px;
    display: block;
    border: 1px solid rgba(0,0,0,0.1);
}

/* Verification Info */
.verification-info {
    background: linear-gradient(135deg, #e8f5e8 0%, #d4edda 100%);
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    border-right: 5px solid #28a745;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.1);
}

.verification-status {
    margin-top: 15px;
    padding: 12px 18px;
    border-radius: 6px;
    font-weight: bold;
    display: inline-block;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.verification-status:hover {
    transform: translateY(-1px);
}

.verification-status.verified {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 2px solid #28a745;
}

.verification-status.unverified {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 2px solid #dc3545;
}

.status-icon {
    font-size: 18px;
    margin-left: 8px;
    display: inline-block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Footer */
.logic-footer {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 2px solid #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 0 0 8px 8px;
    margin: 40px -30px -30px -30px;
}

.powered-by {
    color: #7f8c8d;
    font-size: 14px;
    font-style: italic;
}

.powered-by::before {
    content: "⚡";
    margin-left: 5px;
}

.admin-actions .button {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    border: none;
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
}

.admin-actions .button:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f618d 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .arabic-logic-container {
        padding: 20px;
        margin: 10px;
        border-radius: 6px;
    }
    
    .logic-header {
        padding: 20px 15px 15px;
        margin: -20px -20px 20px -20px;
    }
    
    .logic-title {
        font-size: 26px;
    }
    
    .logic-technical-title {
        font-size: 18px;
    }
    
    .logic-section {
        padding: 20px 15px;
    }
    
    .section-title {
        font-size: 20px;
    }
    
    .logic-footer {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 20px 15px;
        margin: 30px -20px -20px -20px;
    }
    
    .code-block {
        font-size: 12px;
        padding: 20px 15px;
    }
    
    .hash-display code {
        font-size: 10px;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .arabic-logic-container {
        padding: 15px;
        margin: 5px;
    }
    
    .logic-title {
        font-size: 22px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .logic-section {
        padding: 15px;
    }
    
    .verification-status {
        padding: 10px 15px;
        font-size: 14px;
    }
}

/* Print Styles */
@media print {
    .arabic-logic-container {
        box-shadow: none;
        border: 2px solid #000;
        background: white;
    }
    
    .admin-actions {
        display: none;
    }
    
    .logic-header {
        background: white;
        color: black;
    }
    
    .section-title {
        color: black;
    }
    
    .code-block {
        background: #f5f5f5;
        color: black;
        border: 1px solid black;
    }
    
    .hash-display {
        background: #f9f9f9;
        border: 1px solid black;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .arabic-logic-container {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .logic-header {
        background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    }
    
    .logic-title {
        color: #e2e8f0;
    }
    
    .logic-section {
        background: #4a5568;
        border-right-color: #63b3ed;
    }
    
    .section-title {
        color: #63b3ed;
    }
    
    .logic-meta-info {
        background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    }
    
    .verification-info {
        background: linear-gradient(135deg, #2f855a 0%, #276749 100%);
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .arabic-logic-container {
        border: 3px solid #000;
        box-shadow: none;
    }
    
    .section-title {
        color: #000;
        border-bottom-color: #000;
    }
    
    .logic-list li:before {
        color: #000;
    }
    
    .verification-status {
        border-width: 3px;
    }
}

/* Accessibility Enhancements */
.logic-section:focus-within {
    outline: 3px solid #3498db;
    outline-offset: 2px;
}

.admin-actions .button:focus {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
}

/* Animation for loading states */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Copy button for hash */
.hash-copy-button {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #3498db;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hash-display:hover .hash-copy-button {
    opacity: 1;
}

.hash-copy-button:hover {
    background: #2980b9;
}