/* 
 * RABEH Verify Platform
 * Main Stylesheet
 */

/* Prevent flash of wrong content during initial load */
html.initial-load .section {
    display: none !important;
}

/* ===== Base Styles ===== */
:root {
    /* Primary Lavender/Purple Color Palette */
    --primary-25: #F9F8FD;
    --primary-50: #EAE6FA;
    --primary-100: #E1D7FD;
    --primary-200: #CEC6F2;
    --primary-500: #7860DC;
    --primary-600: #604DB0;
    --primary-700: #483A85;
    --primary-800: #392E69;
    --primary-900: #2B234F;
    
    /* Updated Primary Colors */
    --primary-color: var(--primary-500);
    --primary-dark: var(--primary-600);
    --primary-light: var(--primary-200);
    
    /* Secondary and Status Colors */
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --white: #ffffff;
    --black: #000000;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    
    /* Typography */
    --font-family: 'Tajawal', sans-serif;
    --font-size-base: 1rem;
    --font-size-sm: 0.875rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 1.75rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;
    /* Font Weights */
    --font-weight-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    
    /* Spacing */
    --spacing-1: 0.25rem;
    --spacing-2: 0.5rem;
    --spacing-3: 0.75rem;
    --spacing-4: 1rem;
    --spacing-5: 1.5rem;
    --spacing-6: 2rem;
    --spacing-7: 2.5rem;
    --spacing-8: 3rem;
    
    /* Border Radius */
    --border-radius-sm: 0.25rem;
    --border-radius: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition-base: all 0.3s ease;
    --transition-fast: all 0.15s ease;
    --transition-slow: all 0.5s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--gray-800);
    background-color: var(--white);
    direction: rtl;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-base);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== Layout ===== */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: var(--spacing-6) var(--spacing-4);
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* ===== Header ===== */
.header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    padding: var(--spacing-4) 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-4);
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    height: 40px;
    margin-left: var(--spacing-3);
}

.main-nav ul {
    display: flex;
    gap: var(--spacing-5);
}

.nav-link {
    color: var(--gray-700);
    font-weight: 500;
    padding: var(--spacing-2) var(--spacing-3);
    border-radius: var(--border-radius);
    transition: var(--transition-base);
}

.nav-link:hover {
    color: var(--primary-color);
    background-color: var(--gray-100);
    text-decoration: none;
}

.nav-link.active {
    color: var(--primary-color);
    background-color: var(--gray-100);
    font-weight: 700;
}

.menu-link {
    color: var(--gray-700);
    font-weight: 500;
    padding: var(--spacing-2) var(--spacing-3);
    border-radius: var(--border-radius);
    transition: var(--transition-base);
}

.menu-link:hover {
    color: var(--primary-color);
    background-color: var(--gray-100);
    text-decoration: none;
}

.language-links {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-inline-end: var(--spacing-2);
}

.language-links .lang-link {
    color: var(--gray-700);
    padding: var(--spacing-1) var(--spacing-2);
    border-radius: var(--border-radius);
    transition: var(--transition-base);
}

.language-links .lang-link:hover {
    color: var(--primary-color);
    background-color: var(--gray-100);
    text-decoration: none;
}

.language-links .divider { 
    color: var(--gray-400); 
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.user-name {
    font-weight: 500;
}

/* ===== Footer ===== */
.footer {
    background: #7860db; /* rgb(120, 96, 219) */
    color: #ffffff;
    padding: 50px 0 0;
    margin-top: auto;
    font-family: 'Tajawal', sans-serif;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
}

.footer-main {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 1.2fr;
    gap: 40px;
    padding: 30px 0;
    align-items: start;
    direction: ltr;
}

.footer-section { 
    text-align: right; 
    direction: rtl; 
}

.footer-brand {
    text-align: right;
    direction: rtl;
}

.footer-brand h3 {
    text-align: right;
    margin-bottom: 16px;
    color: #ffffff;
}

/* Leftmost column (contact) should be left-aligned per reference */
.footer-contact {
    text-align: left;
    direction: ltr;
}

.footer-contact .contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-contact .contact-list li {
    color: #ffffff;
    opacity: 1;
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 6px;
    font-family: 'Tajawal', sans-serif;
}

.footer-contact .contact-list li.copyright {
    color: #ffffff;
    font-size: 14px;
    font-weight: 400;
}

/* Ensure contact list links match footer text color */
.footer-contact .contact-list a {
    color: #ffffff;
    opacity: 1;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.footer-contact .contact-list a:hover {
    opacity: 1;
}

/* Rightmost brand column logo aligned to the right */
.footer-brand .logo-container {
    display: block;
    width: 100%;
    margin-bottom: 20px;
    margin-right: 0;
    height: 45px;
    text-align: right;
}

.footer-section h3 {
    font-size: 18px;
    margin-bottom: 16px;
    font-weight: 600;
    font-family: 'Tajawal', sans-serif;
    color: #ffffff;
}

.footer-section h3 a {
    font-weight: 400;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section li {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: #ffffff;
    opacity: 1;
    font-family: 'Tajawal', sans-serif;
}

.footer-section a {
    color: #ffffff;
    opacity: 1;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.footer-section a:hover {
    opacity: 1;
}

/* Ensure all footer links remain white in all states */
.footer a,
.footer a:visited,
.footer a:hover,
.footer a:active,
.footer a:focus {
    color: #ffffff;
}

.footer-logos {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 20px;
    height: 45px;
}

/* SAUDI TECH stacked text */
.saudi-tech-text {
    color: #ffffff;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.5px;
    font-size: 16px;
    text-transform: uppercase;
    font-family: 'Tajawal', sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 40px;
}

.saudi-tech-text span { 
    display: block;
    margin: 0;
    padding: 0;
}

.footer-logo {
    height: 64px;
    width: auto;
    object-fit: contain;
}

/* Ensure block layout for predictable sizing */
.footer .footer-logo { display: block; }

/* SAUDI TECH logo */
.footer-logo-saudi {
    height: 44px;
    width: auto;
    object-fit: contain;
    display: inline-block;
}

.footer-logo-rabeh {
    height: 45px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    display: inline-block;
}

.logo-container {
    /* Transparent background to match reference design */
    background: transparent;
    padding: 0;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    min-height: 60px;
}

/* Footer-specific logo container overrides to tighten layout */
.footer .logo-container {
    min-width: auto;
    min-height: auto;
}

.footer-bottom {
    border-top: 1px solid rgba(26, 32, 44, 0.2);
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    direction: ltr;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-4);
    direction: ltr; /* ensure copyright on left, icons on right */
}

.footer-bottom p {
    margin: 0;
    font-size: var(--font-size-sm);
    color: #ffffff;
}

.social-icons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    align-items: center;
}

.footer .social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 1);
    border-radius: 50%;
    color: #7860db;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
}

.social-icon:hover {
    background: #f1eaff;
    transform: translateY(-2px);
}

/* Preserve social icon color against global footer link color */
.footer .social-icon,
.footer .social-icon:visited,
.footer .social-icon:hover,
.footer .social-icon:active,
.footer .social-icon:focus {
    color: #7860db;
}

/* Divider between main grid and bottom bar */
.footer-divider {
    height: 1px;
    background: rgba(26, 32, 44, 0.25);
    width: 100%;
    margin: var(--spacing-4) 0 var(--spacing-3);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .footer-main { grid-template-columns: 1fr 1fr; gap: var(--spacing-6); }
}

@media (max-width: 640px) {
    .footer-main { grid-template-columns: 1fr; }
    .footer-bottom-content { justify-content: center; gap: var(--spacing-3); text-align: center; }
    /* Reset right nudge on mobile and center the logo */
    .footer-brand .logo-container { margin-right: 0; justify-content: center; }
}

/* ===== Sections ===== */
.section {
    display: none;
    animation: fadeIn 0.5s ease;
}

.section.active {
    display: block;
}

.section-header {
    margin-bottom: var(--spacing-6);
    text-align: center;
}

.section-header h1 {
    font-size: var(--font-size-3xl);
    color: var(--gray-900);
    font-weight: 700;
}

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

/* ===== Dashboard ===== */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-4);
    margin-bottom: var(--spacing-6);
}

.stat-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: var(--spacing-5);
    text-align: center;
}

.stat-card h3 {
    font-size: var(--font-size-lg);
    color: var(--gray-700);
    margin-bottom: var(--spacing-3);
}

.stat-value {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--primary-color);
}

.quick-actions {
    margin-top: var(--spacing-6);
}

.quick-actions h2 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-4);
    color: var(--gray-800);
}

.action-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-4);
}

.action-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: var(--spacing-5);
}

.action-card h3 {
    font-size: var(--font-size-lg);
    color: var(--gray-700);
    margin-bottom: var(--spacing-4);
}

.action-form {
    display: flex;
    gap: var(--spacing-2);
}

.action-form input {
    flex: 1;
}

.recent-contracts {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3);
}

.recent-contracts li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-2) 0;
    border-bottom: 1px solid var(--gray-200);
}

.recent-contracts li:last-child {
    border-bottom: none;
}

.contract-id {
    font-weight: 500;
}

.contract-status {
    padding: var(--spacing-1) var(--spacing-2);
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.contract-status.verified {
    background-color: var(--success-color);
    color: var(--white);
}

.contract-status.pending {
    background-color: var(--warning-color);
    color: var(--gray-900);
}

/* ===== Contracts ===== */
.contracts-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-4);
}

.contract-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: var(--spacing-5);
    transition: var(--transition-base);
}

.contract-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.contract-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-4);
}

.contract-header h3 {
    font-size: var(--font-size-lg);
    color: var(--gray-900);
}

.contract-details {
    margin-bottom: var(--spacing-4);
}

.contract-details p {
    margin-bottom: var(--spacing-2);
}

.contract-actions {
    display: flex;
    justify-content: flex-end;
}

/* ===== Verification Result Styles ===== */
.verification-result {
    max-width: 100%;
    overflow: hidden;
}

.result-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-4);
    margin-top: var(--spacing-4);
}

.detail-item {
    background-color: var(--gray-50);
    padding: var(--spacing-4);
    border-radius: var(--border-radius);
    text-align: center;
    overflow: hidden;
    min-width: 0;
}

.detail-label {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    font-weight: var(--font-medium);
    margin-bottom: var(--spacing-2);
}

.detail-value {
    font-size: var(--font-size-base);
    color: var(--gray-900);
    font-weight: var(--font-semibold);
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
    max-width: 100%;
}

/* Special handling for wallet addresses */
.detail-value.wallet-address {
    font-family: monospace;
    font-size: var(--font-size-sm);
    letter-spacing: -0.5px;
}

/* Center align verification content */
.verify-section,
.verification-result {
    margin-left: auto;
    margin-right: auto;
    max-width: 1200px;
}

/* ===== Wallet ===== */
.wallet-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--spacing-4);
}

.wallet-card, .transactions-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: var(--spacing-5);
}

.wallet-header, .transactions-header {
    margin-bottom: var(--spacing-4);
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: var(--spacing-3);
}

.wallet-header h3, .transactions-header h3 {
    font-size: var(--font-size-lg);
    color: var(--gray-800);
}

.wallet-details p {
    margin-bottom: var(--spacing-3);
}

.wallet-address {
    font-family: monospace;
    font-size: var(--font-size-sm);
    background-color: var(--gray-100);
    padding: var(--spacing-1) var(--spacing-2);
    border-radius: var(--border-radius-sm);
    word-break: break-all;
}

.wallet-balance {
    font-weight: 700;
    color: var(--primary-color);
}

.wallet-status {
    padding: var(--spacing-1) var(--spacing-2);
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.wallet-status.active {
    background-color: var(--success-color);
    color: var(--white);
}

.transactions-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
}

.transaction-item {
    display: flex;
    gap: var(--spacing-3);
    padding: var(--spacing-3);
    border-radius: var(--border-radius);
    background-color: var(--gray-100);
}

.transaction-id {
    font-family: monospace;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 80px;
}

.transaction-details {
    flex: 1;
}

.transaction-details p {
    margin-bottom: var(--spacing-1);
    font-size: var(--font-size-sm);
}

.transaction-actions {
    display: flex;
    align-items: center;
}

/* ===== Verify ===== */
.verify-container {
    max-width: 800px;
    margin: 0 auto;
}

.verify-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: var(--spacing-5);
    margin-bottom: var(--spacing-5);
}

.verify-header {
    margin-bottom: var(--spacing-4);
    text-align: center;
}

.verify-header h3 {
    font-size: var(--font-size-xl);
    color: var(--gray-800);
}

.verify-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
}

.form-group label {
    font-weight: 500;
    color: var(--gray-700);
}

.form-actions {
    display: flex;
    justify-content: center;
    margin-top: var(--spacing-2);
}

.sample-contracts {
    text-align: center;
    margin-top: var(--spacing-4);
    padding-top: var(--spacing-4);
    border-top: 1px solid var(--gray-200);
}

.sample-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-2);
    margin-top: var(--spacing-2);
}

.verification-result {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: var(--spacing-5);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-4);
    padding-bottom: var(--spacing-3);
    border-bottom: 1px solid var(--gray-200);
}

.result-header h3 {
    font-size: var(--font-size-xl);
    color: var(--gray-800);
}

.result-status {
    padding: var(--spacing-1) var(--spacing-3);
    border-radius: var(--border-radius);
    font-weight: 500;
}

.result-status.verified,
.result-status.active {
    background-color: var(--success-color);
    color: var(--white);
}

.result-status.withdrawn {
    background-color: var(--warning-color);
    color: var(--dark-color);
}

.result-status.expired {
    background-color: var(--gray-600);
    color: var(--white);
}

.result-status.pending {
    background-color: var(--info-color);
    color: var(--white);
}

.result-status.not-found {
    background-color: var(--danger-color);
    color: var(--white);
}

.result-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-5);
}

.result-section h4 {
    font-size: var(--font-size-lg);
    color: var(--gray-700);
    margin-bottom: var(--spacing-3);
    padding-bottom: var(--spacing-2);
    border-bottom: 1px solid var(--gray-200);
}

.result-section p {
    margin-bottom: var(--spacing-3);
}

.blockchain-link {
    margin-top: var(--spacing-4);
    text-align: center;
}

/* ===== API ===== */
.api-container {
    max-width: 900px;
    margin: 0 auto;
}

.api-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: var(--spacing-5);
}

.api-header {
    margin-bottom: var(--spacing-4);
    text-align: center;
}

.api-header h3 {
    font-size: var(--font-size-xl);
    color: var(--gray-800);
}

.api-content {
    line-height: 1.6;
}

.api-section {
    margin-top: var(--spacing-5);
}

.api-section h4 {
    font-size: var(--font-size-lg);
    color: var(--gray-800);
    margin-bottom: var(--spacing-3);
    padding-bottom: var(--spacing-2);
    border-bottom: 1px solid var(--gray-200);
}

.api-endpoint {
    margin-bottom: var(--spacing-4);
    padding: var(--spacing-3);
    background-color: var(--gray-100);
    border-radius: var(--border-radius);
}

.api-endpoint h5 {
    font-size: var(--font-size-base);
    color: var(--gray-900);
    margin-bottom: var(--spacing-2);
}

.api-endpoint pre {
    background-color: var(--gray-800);
    color: var(--white);
    padding: var(--spacing-2) var(--spacing-3);
    border-radius: var(--border-radius-sm);
    overflow-x: auto;
    margin: var(--spacing-2) 0;
    font-family: monospace;
}

.api-endpoint p {
    margin-bottom: var(--spacing-2);
    font-size: var(--font-size-sm);
}

.api-section ul {
    list-style-type: none;
    padding: 0;
}

.api-section ul li {
    padding: 8px 0;
    padding-right: 20px;
    border-bottom: 1px solid var(--gray-200);
    position: relative;
}

.api-section ul li:before {
    content: "✓";
    color: #48bb78;
    font-weight: bold;
    position: absolute;
    right: 0;
}

.api-section ul li:last-child {
    border-bottom: none;
}

/* API Documentation Styles */
.api-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.api-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.api-content {
    padding: 30px;
}

.api-content.hidden {
    display: none;
}

.language-toggle {
    display: flex;
    gap: 10px;
    margin-left: 20px;
}

.lang-btn {
    padding: 8px 16px;
    border: 2px solid #1a365d;
    background: transparent;
    color: #1a365d;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: #1a365d;
    color: white;
}

.lang-btn.active {
    background: #1a365d;
    color: white;
}

.api-section {
    margin-bottom: 40px;
}

.api-section h4 {
    color: #1a365d;
    margin-bottom: 20px;
    font-size: 1.4em;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.api-endpoint {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.api-endpoint h5 {
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.api-endpoint pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 10px 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.api-endpoint code {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.code-example {
    margin-top: 15px;
    padding: 15px;
    background: #edf2f7;
    border-radius: 6px;
    border-left: 4px solid #4299e1;
}

.code-example strong {
    color: #2d3748;
    display: block;
    margin-bottom: 8px;
}

.code-example pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 12px;
    border-radius: 4px;
    margin: 8px 0 0 0;
    font-size: 0.85em;
}

.api-section ul {
    list-style: disc;
    padding-right: var(--spacing-5);
    margin-top: var(--spacing-2);
}

.api-section ul li {
    margin-bottom: var(--spacing-2);
}

/* Responsive Design for API Documentation */
@media (max-width: 768px) {
    .api-content {
        padding: 20px;
    }
    
    .language-toggle {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .api-endpoint pre {
        font-size: 0.8em;
        padding: 10px;
    }
    
    .code-example pre {
        font-size: 0.75em;
    }
}

/* ===== Forms ===== */
input, textarea, select {
    width: 100%;
    padding: var(--spacing-3);
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    transition: var(--transition-base);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.2);
}

.form-hint {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    margin-top: var(--spacing-1);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2) var(--spacing-4);
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-base);
    border: none;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    color: var(--white);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-sm {
    padding: var(--spacing-1) var(--spacing-3);
    font-size: var(--font-size-sm);
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    animation: slideIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-4);
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h2 {
    font-size: var(--font-size-xl);
    color: var(--gray-800);
}

.close-modal {
    background: none;
    border: none;
    font-size: var(--font-size-2xl);
    color: var(--gray-500);
    cursor: pointer;
    transition: var(--transition-base);
}

.close-modal:hover {
    color: var(--gray-800);
}

.modal-body {
    padding: var(--spacing-4);
}

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

/* ===== Notification System ===== */
.notification-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
    width: 100%;
    max-width: 400px;
}

.notification {
    padding: var(--spacing-3) var(--spacing-4);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    animation: slideDown 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-success {
    background-color: var(--success-color);
    color: var(--white);
}

.notification-error {
    background-color: var(--danger-color);
    color: var(--white);
}

.notification-info {
    background-color: var(--info-color);
    color: var(--white);
}

.notification-close {
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    font-size: var(--font-size-lg);
    opacity: 0.7;
    transition: var(--transition-base);
}

.notification-close:hover {
    opacity: 1;
}

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

/* ===== Utilities ===== */
.hidden {
    display: none !important;
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
    .wallet-container {
        grid-template-columns: 1fr;
    }
    
    /* Verify section responsive */
    .verify-form {
        padding: 0 var(--spacing-3);
    }
    
    .result-details {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: var(--spacing-3);
    }
    
    .main-nav ul {
        gap: var(--spacing-3);
    }
    
    .nav-link {
        padding: var(--spacing-2);
    }
    
    .menu-link {
        padding: var(--spacing-2);
    }
    
    .footer-content {
        flex-direction: column;
        gap: var(--spacing-4);
    }
    
    .footer-links ul {
        flex-direction: column;
        gap: var(--spacing-2);
    }
    
    /* Verify section mobile styles */
    #verify {
        padding: var(--spacing-2);
    }
    
    .verify-section {
        padding: var(--spacing-3);
    }
    
    .verify-form {
        padding: var(--spacing-3);
    }
    
    .contract-input {
        font-size: var(--font-size-base);
        padding: var(--spacing-3);
    }
    
    .verification-result {
        padding: var(--spacing-3);
        margin: var(--spacing-2) 0;
    }
    
    .result-header {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-3);
    }
    
    .result-icon {
        margin: 0 auto;
    }
    
    .result-details {
        grid-template-columns: 1fr;
        gap: var(--spacing-2);
    }
    
    .detail-item {
        padding: var(--spacing-3);
        text-align: center;
    }
    
    .detail-label {
        margin-bottom: var(--spacing-2);
    }
    
    .verification-actions {
        flex-direction: column;
        gap: var(--spacing-2);
        padding: var(--spacing-3) 0;
    }
    
    .verification-actions .btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
    
    .error-message {
        padding: var(--spacing-3);
        margin: var(--spacing-3) 0;
    }
}

@media (max-width: 576px) {
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .action-form {
        flex-direction: column;
    }
    
    .stat-card {
        padding: var(--spacing-3);
    }
    
    .transaction-item {
        flex-direction: column;
    }
    
    /* Verify section for small screens */
    .section-content {
        padding: var(--spacing-2);
    }
    
    .verify-header h3 {
        font-size: var(--font-size-lg);
    }
    
    .verify-header p {
        font-size: var(--font-size-sm);
    }
    
    .sample-contracts {
        flex-direction: column;
        gap: var(--spacing-2);
    }
    
    .sample-contract {
        width: 100%;
    }
}

/* ===== RTL Specific Styles ===== */
[dir="rtl"] .logo {
    margin-left: var(--spacing-3);
    margin-right: 0;
}

[dir="rtl"] .detail-item {
    text-align: center;
}

[dir="rtl"] .verification-result {
    direction: rtl;
}

[dir="rtl"] .detail-value {
    direction: ltr;
    unicode-bidi: embed;
}

[dir="rtl"] .close-modal {
    margin-right: auto;
    margin-left: 0;
}

/* ===== English Language Styles ===== */
[dir="ltr"] .logo {
    margin-right: var(--spacing-3);
    margin-left: 0;
}

/* Modal Dialog */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--white);
    margin: auto;
    padding: 0;
    border-radius: var(--spacing-2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    animation: modalFadeIn 0.3s;
}

.modal-header {
    padding: var(--spacing-4);
    border-bottom: 1px solid var(--gray-300);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.modal-title-ar, .modal-title-en {
    margin: 0;
    font-size: var(--font-size-xl);
}

.modal-title-en, .modal-button-en {
    display: none;
}

[dir="ltr"] .modal-title-ar, [dir="ltr"] .modal-button-ar, [dir="ltr"] .modal-message-ar {
    display: none;
}

[dir="ltr"] .modal-title-en, [dir="ltr"] .modal-button-en, [dir="ltr"] .modal-message-en {
    display: block;
}

.modal-close {
    color: var(--gray-600);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: var(--spacing-4);
}

[dir="ltr"] .modal-close {
    right: auto;
    left: var(--spacing-4);
}

.modal-close:hover,
.modal-close:focus {
    color: var(--dark-color);
    text-decoration: none;
}

.modal-body {
    padding: var(--spacing-5);
}

.modal-footer {
    padding: var(--spacing-4);
    border-top: 1px solid var(--gray-300);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-3);
}

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

[dir="ltr"] .close-modal {
    margin-left: auto;
    margin-right: 0;
}

/* ===== Print Styles ===== */
@media print {
    .header, .footer, .form-actions, .sample-contracts {
        display: none;
    }
    
    .main-content {
        padding: 0;
    }
    
    .verification-result {
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
}

/* ===== Authentication Mode Toggle ===== */
.auth-mode-toggle {
    display: flex;
    margin-bottom: var(--spacing-5);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--gray-300);
}

.mode-btn {
    flex: 1;
    padding: var(--spacing-3) var(--spacing-4);
    background-color: var(--gray-100);
    border: none;
    color: var(--gray-600);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-base);
    font-family: var(--font-family);
}

.mode-btn.active {
    background-color: var(--primary-color);
    color: var(--white);
}

.mode-btn:hover:not(.active) {
    background-color: var(--gray-200);
    color: var(--gray-800);
}

/* ===== Authentication Forms ===== */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.security-notice {
    background-color: var(--warning-color);
    color: var(--gray-800);
    padding: var(--spacing-3);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-4);
    border-left: 4px solid #e6a800;
}

.security-notice p {
    margin: 0;
    font-size: var(--font-size-sm);
    line-height: 1.4;
}

.form-hint {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    margin-top: var(--spacing-1);
    margin-bottom: 0;
}

/* ===== Responsive Design for Registration ===== */
@media (max-width: 768px) {
    .modal-content {
        margin: var(--spacing-4);
        max-width: none;
    }
    
    .auth-mode-toggle {
        flex-direction: column;
    }
    
    .mode-btn {
        border-radius: 0;
    }
    
    .mode-btn:first-child {
        border-top-left-radius: var(--border-radius);
        border-top-right-radius: var(--border-radius);
    }
    
    .mode-btn:last-child {
        border-bottom-left-radius: var(--border-radius);
        border-bottom-right-radius: var(--border-radius);
    }
}
