/* 
   Main CSS File for فريق عبد الرحمن Website
   Supports accessibility features for blind and visually impaired users
*/

:root {
    --primary-color: #2e7d32;
    --secondary-color: #1565c0;
    --accent-color: #f57c00;
    --text-color: #212121;
    --text-light: #757575;
    --background-color: #ffffff;
    --background-alt: #f5f5f5;
    --border-color: #e0e0e0;
    --success-color: #4caf50;
    --error-color: #f44336;
    --warning-color: #ff9800;
    --info-color: #2196f3;
    --shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

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

body {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
    direction: rtl;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--text-color);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
    position: relative;
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 1rem;
}

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

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

ul, ol {
    margin-bottom: 1rem;
    padding-right: 1.5rem;
}

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

/* Accessibility Enhancements */
:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -40px;
    right: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    z-index: 100;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    transition: var(--transition);
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.btn:hover, .btn:focus {
    background-color: #1b5e20;
    color: white;
    text-decoration: none;
}

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

.btn.secondary:hover, .btn.secondary:focus {
    background-color: #0d47a1;
}

.btn.small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Header Styles */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

header .container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

header h1 {
    margin-bottom: 0.5rem;
    color: white;
}

header p {
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.9);
}

nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 0;
}

nav ul li {
    margin: 0 0.5rem;
}

nav ul li a {
    color: white;
    padding: 0.5rem;
    display: block;
    font-weight: 600;
    position: relative;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background-color: white;
    transition: var(--transition);
}

nav ul li a:hover::after, nav ul li a.active::after {
    width: 100%;
}

nav ul li a:hover, nav ul li a:focus, nav ul li a.active {
    text-decoration: none;
}

#menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

#menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 5px 0;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    background-color: var(--background-alt);
    padding: 4rem 0;
    text-align: center;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: var(--text-light);
}

.cta-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

/* Features Section */
.features {
    padding: 4rem 0;
    background-color: var(--background-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card {
    background-color: var(--background-alt);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(46, 125, 50, 0.1);
    border-radius: 50%;
}

.feature-icon img {
    width: 40px;
    height: 40px;
}

.feature-card h3 {
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

/* Apps Section */
.apps-section {
    padding: 4rem 0;
    background-color: var(--background-alt);
}

.apps-section:nth-child(even) {
    background-color: var(--background-color);
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.app-card {
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.app-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.app-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    overflow: hidden;
}

.app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-card h3 {
    margin-bottom: 1rem;
    text-align: center;
}

.app-card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.app-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.stars {
    color: var(--accent-color);
    margin-right: 0.5rem;
}

.rating-count {
    color: var(--text-light);
    font-size: 0.875rem;
}

.app-features {
    list-style: none;
    padding: 0;
    margin-bottom: 1.5rem;
}

.app-features li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    padding-right: 1.5rem;
}

.app-features li::before {
    content: '✓';
    color: var(--success-color);
    position: absolute;
    right: 0;
}

.app-links {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.load-more {
    display: block;
    margin: 0 auto;
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0.5rem 0.5rem;
    transition: var(--transition);
}

.tab-btn:hover, .tab-btn:focus {
    background-color: var(--background-alt);
}

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

.tab-content {
    display: none;
}

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

/* Feature Section */
.feature-section {
    padding: 4rem 0;
    background-color: var(--background-color);
}

.feature-section:nth-child(even) {
    background-color: var(--background-alt);
}

.feature-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-top: 2rem;
}

.feature-image {
    flex: 1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.feature-text {
    flex: 1;
}

.feature-text h3 {
    margin-bottom: 1.5rem;
}

.feature-text h4 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.feature-text p {
    margin-bottom: 1.5rem;
}

.feature-text ul, .feature-text ol {
    margin-bottom: 1.5rem;
}

.feature-text li {
    margin-bottom: 0.5rem;
}

.upload-form {
    background-color: var(--background-alt);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1.5rem;
}

/* Contact Section */
.contact-section {
    padding: 4rem 0;
    background-color: var(--background-alt);
}

.contact-content {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.contact-info {
    flex: 1;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
}

.contact-icon {
    width: 60px;
    height: 60px;
    background-color: rgba(46, 125, 50, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 1.5rem;
}

.contact-icon img {
    width: 30px;
    height: 30px;
}

.contact-text h3 {
    margin-bottom: 0.5rem;
}

.contact-form {
    flex: 1;
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus, .form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.2);
}

/* Footer */
footer {
    background-color: #1b5e20;
    color: white;
    padding: 4rem 0 2rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-logo {
    flex: 1;
    min-width: 250px;
}

.footer-logo h2 {
    color: white;
    margin-bottom: 1rem;
}

.footer-logo h2::after {
    background-color: white;
}

.footer-logo p {
    color: rgba(255, 255, 255, 0.8);
}

.footer-links {
    flex: 1;
    min-width: 250px;
}

.footer-links h3 {
    color: white;
    margin-bottom: 1.5rem;
}

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

.footer-links ul li {
    margin-bottom: 0.5rem;
}

.footer-links ul li a {
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
}

.footer-links ul li a:hover, .footer-links ul li a:focus {
    color: white;
    text-decoration: none;
}

.footer-social {
    flex: 1;
    min-width: 250px;
}

.footer-social h3 {
    color: white;
    margin-bottom: 1.5rem;
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: var(--transition);
}

.social-icons a:hover, .social-icons a:focus {
    background-color: rgba(255, 255, 255, 0.2);
}

.social-icons img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: var(--background-color);
    margin: 10% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.close {
    position: absolute;
    left: 1.5rem;
    top: 1.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
}

.voice-recorder, .dictation-system {
    margin-top: 2rem;
}

.recorder-controls, .dictation-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.recorder-status, .dictation-status {
    text-align: center;
    margin-bottom: 1.5rem;
}

#recording-timer {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.recorder-visualizer {
    width: 100%;
    height: 100px;
    margin-bottom: 1.5rem;
}

#visualizer {
    width: 100%;
    height: 100%;
    background-color: var(--background-alt);
    border-radius: 4px;
}

.recorder-actions, .dictation-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.dictation-result {
    margin-bottom: 1.5rem;
}

#dictation-text {
    width: 100%;
    height: 150px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    resize: none;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .feature-content {
        flex-direction: column;
    }
    
    .contact-content {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    header .container {
        flex-direction: row;
        justify-content: space-between;
    }
    
    nav {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 80%;
        height: calc(100vh - 70px);
        background-color: var(--primary-color);
        transition: var(--transition);
        z-index: 1000;
        padding: 2rem;
        overflow-y: auto;
    }
    
    nav.active {
        right: 0;
    }
    
    nav ul {
        flex-direction: column;
        align-items: flex-start;
    }
    
    nav ul li {
        margin: 0.5rem 0;
        width: 100%;
    }
    
    nav ul li a {
        padding: 0.75rem 0;
        width: 100%;
    }
    
    #menu-toggle {
        display: block;
    }
    
    .menu-open #menu-toggle span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .menu-open #menu-toggle span:nth-child(2) {
        opacity: 0;
    }
    
    .menu-open #menu-toggle span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
    
    .apps-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .modal-content {
        margin: 20% auto;
        padding: 1.5rem;
    }
    
    .recorder-controls, .dictation-controls, .recorder-actions, .dictation-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        margin-right: 0;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #006400;
        --secondary-color: #00008b;
        --accent-color: #b35900;
        --text-color: #000000;
        --text-light: #333333;
        --background-color: #ffffff;
        --background-alt: #f0f0f0;
        --border-color: #000000;
    }
    
    .btn, .tab-btn.active {
        border: 2px solid black;
    }
    
    a {
        text-decoration: underline;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    .feature-card:hover, .app-card:hover {
        transform: none;
    }
}

/* Print Styles */
@media print {
    header, footer, .cta-buttons, .btn, .tabs, .social-icons {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background-color: #fff;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    .container {
        width: 100%;
        max-width: none;
        padding: 0;
    }
    
    .apps-grid, .features-grid {
        display: block;
    }
    
    .app-card, .feature-card {
        page-break-inside: avoid;
        margin-bottom: 1cm;
    }
}
