body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    direction: rtl;
}

body.high-contrast {
    background-color: black;
    color: white;
}

body.high-contrast .container {
    background-color: black;
}

body.large-text {
    font-size: 1.2em;
}

body.dark-mode {
    background-color: #121212;
    color: #ffffff;
}

body.dark-mode .container {
    background-color: #1e1e1e;
    color: #ffffff;
}

body.dark-mode header {
    background: linear-gradient(135deg, #1a1a1a 0%, #333333 100%);
}

body.dark-mode .service-section {
    background-color: #2a2a2a;
}

body.dark-mode .feature {
    background-color: #2c2c2c;
    color: #ffffff;
}

body.dark-mode .feature-btn {
    background-color: #4a4a4a;
    color: #ffffff;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.container:hover {
    box-shadow: 0 20px 45px rgba(0,0,0,0.15);
}

header {
    text-align: center;
    background: linear-gradient(135deg, #4A90E2 0%, #5FDDE5 100%);
    color: white;
    padding: 30px 20px;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255,255,255,0.1);
    transform: rotate(-45deg);
    z-index: 1;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

nav ul {
    display: flex;
    justify-content: space-around;
    list-style: none;
    padding: 0;
}

nav a {
    text-decoration: none;
    color: #3498db;
    font-weight: bold;
}

section {
    background-color: white;
    margin: 20px 0;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.feature {
    background-color: #ecf0f1;
    padding: 15px;
    margin: 10px 0;
    border-radius: 5px;
}

.feature-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    margin: 10px 0;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.feature-btn:hover {
    background-color: #2980b9;
}

.feature-output {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    padding: 10px;
    margin-top: 10px;
    border-radius: 5px;
    min-height: 100px;
}

.feature ul {
    list-style-type: disc;
    padding-right: 20px;
}

.feature p {
    margin-bottom: 15px;
}

textarea {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: vertical;
}

.accessibility-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.accessibility-options label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.emergency-section {
    background-color: #e74c3c;
    color: white;
    text-align: center;
    padding: 20px;
    border-radius: 10px;
}

.emergency-section button {
    background-color: white;
    color: #e74c3c;
    border: none;
    padding: 10px 20px;
    margin: 10px;
    border-radius: 5px;
    cursor: pointer;
}

.emergency-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.back-btn {
    background-color: #3498db;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    display: inline-block;
    margin-top: 10px;
}

.services-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.service-section {
    display: block;
    border-radius: 15px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    perspective: 1000px;
    position: relative;
    overflow: hidden;
}

.services-grid .service-section:hover {
    transform: scale(1.05) rotateX(10deg);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.service-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 30px;
    text-decoration: none;
    color: white;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.service-link::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-link:hover::after {
    opacity: 1;
}

.service-section:hover .service-link {
    transform: translateY(-10px);
    box-shadow: 0 15px 25px rgba(0,0,0,0.2);
    background: rgba(255,255,255,0.1);
}

.service-icon {
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.service-section:hover .service-icon {
    transform: translateY(-10px);
}

.disability-icon {
    width: 150px;
    height: 150px;
    transition: transform 0.3s ease;
}

.service-section:hover .disability-icon {
    transform: scale(1.1) rotate(10deg);
}

.service-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-section:hover::before {
    opacity: 1;
}

.service-section h2 {
    margin: 10px 0;
    font-size: 1.5em;
    transition: all 0.3s ease;
}

.service-section:hover h2 {
    animation: textGlow 2s infinite;
}

.service-section p {
    opacity: 0.8;
    font-size: 1em;
}

@keyframes textGlow {
    0%, 100% { text-shadow: 0 0 5px rgba(52, 152, 219, 0.5); }
    50% { text-shadow: 0 0 15px rgba(46, 204, 113, 0.7); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes handWave {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(30deg); }
}

@keyframes pointGesture {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(20px); }
}

@keyframes raiseHand {
    0% { transform: translateY(0); }
    50% { transform: translateY(-50px); }
    100% { transform: translateY(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes walkingAnimation {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes dynamicWalkingMotion {
    0%, 100% { 
        transform: translateY(0) rotate(0deg);
    }
    25% { 
        transform: translateY(-30px) rotate(10deg);
    }
    75% { 
        transform: translateY(-20px) rotate(-10deg);
    }
}

.motor-support {
    background: linear-gradient(135deg, #8E44AD 0%, #9B59B6 100%);
}

.hearing-support {
    background: linear-gradient(135deg, #E67E22 0%, #D35400 100%);
}

.visual-support {
    background: linear-gradient(135deg, #1ABC9C 0%, #16A085 100%);
}

.inspirational-section {
    background: linear-gradient(135deg, #FF6B6B 0%, #4ECDC4 100%);
    color: white;
    text-align: center;
    padding: 40px 20px;
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.inspirational-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255,255,255,0.1);
    transform: rotate(45deg);
    z-index: 1;
}

.inspirational-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.inspirational-section h2 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.inspirational-section p {
    font-size: 1.2em;
    max-width: 600px;
    line-height: 1.6;
}

.inspiration-svg {
    max-width: 500px;
    width: 100%;
    height: 300px;
    animation: float 4s ease-in-out infinite;
}

.hope-figure {
    max-width: 300px;
    width: 100%;
    height: 200px;
}

.gesture-translation {
    background-color: #f0f4f8;
    border-radius: 10px;
    padding: 20px;
    margin: 15px 0;
}

.gesture-visualization {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

#gesture-svg {
    max-width: 300px;
    width: 100%;
    height: 200px;
}

#gesture-description {
    text-align: center;
    font-weight: bold;
    color: #2c3e50;
}

.electronic-control {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.device-card {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.device-card:hover {
    transform: scale(1.05);
}

.device-card i {
    font-size: 3em;
    color: #3498db;
    margin-bottom: 10px;
}

.device-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.control-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 0.9em;
}

.control-btn:hover {
    background-color: #2980b9;
}

.device-registration {
    background-color: #f1f1f1;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.device-registration-form {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.device-registration-form input,
.device-registration-form select {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.device-registration-form button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.device-registration-form button:hover {
    background-color: #2980b9;
}

.registered-devices {
    background-color: white;
    padding: 15px;
    border-radius: 5px;
}

.registered-devices ul {
    list-style-type: none;
    padding: 0;
}

.registered-devices li {
    background-color: #f9f9f9;
    margin: 5px 0;
    padding: 10px;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.registered-devices .remove-device {
    color: #e74c3c;
    cursor: pointer;
    font-weight: bold;
}

#navigation-safety {
    background-color: #f4f4f4;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.navigation-safety-feature {
    background-color: white;
    border: 1px solid #e0e0e0;
    padding: 20px;
    border-radius: 10px;
}

.safety-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.safety-toggle, 
.safety-options,
.emergency-contact {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
}

.emergency-contact .contact-input {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.emergency-contact input {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.emergency-contact button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
}

#emergency-contacts-list {
    list-style-type: none;
    padding: 0;
}

#emergency-contacts-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f1f1f1;
    margin: 5px 0;
    padding: 10px;
    border-radius: 5px;
}

.remove-contact {
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.navigation-alerts {
    background-color: #ecf0f1;
    padding: 15px;
    border-radius: 5px;
}

.alerts-log {
    max-height: 200px;
    overflow-y: auto;
    direction: rtl;
}

.alerts-log div {
    margin: 5px 0;
    padding: 5px;
    background-color: #f8f8f8;
    border-radius: 3px;
}

@media (max-width: 768px) {
    .services-grid {
        display: flex;
        flex-direction: column;
    }
    
    .services-grid .service-section {
        margin-bottom: 20px;
    }
    .hope-figure {
        max-width: 200px;
    }
}