/* حاسبة الموارد البشرية - التصميم المتجاوب */

/* Base breakpoints */
/* xs: 0px - 575px (phones) */
/* sm: 576px - 767px (large phones) */
/* md: 768px - 991px (tablets) */
/* lg: 992px - 1199px (desktops) */
/* xl: 1200px+ (large desktops) */

/* Extra Large Screens (1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    .hero h2 {
        font-size: 3.5rem;
    }
    
    .hero p {
        font-size: 1.375rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Large Screens (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .container {
        max-width: 960px;
    }
    
    .hero h2 {
        font-size: 3rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Medium Screens (768px - 991px) - Tablets */
@media (min-width: 768px) and (max-width: 991px) {
    .container {
        max-width: 720px;
        padding: 0 1.5rem;
    }
    
    /* Header */
    .header-content {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .nav {
        gap: 1.5rem;
    }
    
    .nav a {
        font-size: 0.875rem;
    }
    
    /* Hero */
    .hero {
        padding: 3rem 0;
    }
    
    .hero h2 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1.125rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-buttons .btn {
        width: 250px;
    }
    
    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    /* Calculator */
    .calculator-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid var(--border-color);
        border-radius: 0;
    }
    
    .tab-btn.active {
        border-bottom: 3px solid var(--primary-color);
    }
    
    .tab-content {
        padding: 1.5rem;
    }
    
    .allowances-section {
        padding: 1rem;
    }
    
    .results .breakdown {
        grid-template-columns: 1fr;
    }
    
    .comparison-results {
        grid-template-columns: 1fr;
    }
    
    /* Tools */
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .tool-card {
        padding: 1.5rem;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
}

/* Small Screens (576px - 767px) - Large Phones */
@media (min-width: 576px) and (max-width: 767px) {
    .container {
        max-width: 540px;
        padding: 0 1rem;
    }
    
    /* Header */
    .header {
        padding: 0.75rem 0;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .logo h1 {
        font-size: 1.25rem;
    }
    
    .nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .nav a {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    /* Hero */
    .hero {
        padding: 2.5rem 0;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
    
    .hero-buttons .btn {
        width: 200px;
    }
    
    /* Sections */
    .section-title {
        font-size: 2rem;
    }
    
    .features,
    .calculator-section,
    .tools-section {
        padding: 3rem 0;
    }
    
    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .feature-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    /* Calculator */
    .calculator-card {
        margin: 0 -1rem;
        border-radius: 0;
    }
    
    .calculator-tabs {
        flex-direction: column;
        margin-bottom: 1rem;
    }
    
    .tab-btn {
        width: 100%;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid var(--border-color);
        border-radius: 0;
    }
    
    .tab-content {
        padding: 1rem;
    }
    
    .allowances-section {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .results .amount {
        font-size: 2rem;
    }
    
    .results .breakdown {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .comparison-results {
        grid-template-columns: 1fr;
    }
    
    /* Tools */
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .tool-card {
        padding: 1.5rem;
    }
    
    .tool-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    /* Footer */
    .footer {
        padding: 2rem 0 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }
    
    .social-links {
        justify-content: center;
    }
}

/* Extra Small Screens (up to 575px) - Phones */
@media (max-width: 575px) {
    .container {
        padding: 0 1rem;
    }
    
    /* Header */
    .header {
        padding: 0.5rem 0;
    }
    
    .header-content {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .logo {
        gap: 0.5rem;
    }
    
    .logo i {
        font-size: 1.5rem;
    }
    
    .logo h1 {
        font-size: 1.125rem;
    }
    
    .nav {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .nav a {
        font-size: 0.875rem;
        padding: 0.5rem;
        text-align: center;
        width: 100%;
    }
    
    /* Hero */
    .hero {
        padding: 2rem 0;
    }
    
    .hero h2 {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }
    
    .hero p {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
    
    .hero-buttons .btn {
        width: 180px;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    /* Typography */
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    h4 {
        font-size: 1.125rem;
    }
    
    .section-title {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }
    
    /* Sections */
    .features,
    .calculator-section,
    .tools-section {
        padding: 2.5rem 0;
    }
    
    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .feature-card {
        padding: 1rem;
    }
    
    .feature-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .feature-card h3 {
        font-size: 1rem;
    }
    
    .feature-card p {
        font-size: 0.875rem;
    }
    
    /* Calculator */
    .calculator-card {
        margin: 0 -1rem;
        border-radius: 0;
        box-shadow: none;
        border: none;
        border-top: 1px solid var(--border-color);
        border-bottom: 1px solid var(--border-color);
    }
    
    .calculator-tabs {
        flex-direction: column;
        margin-bottom: 1rem;
        border-bottom: none;
    }
    
    .tab-btn {
        width: 100%;
        padding: 0.75rem;
        border-bottom: 1px solid var(--border-color);
        border-radius: 0;
        font-size: 0.875rem;
    }
    
    .tab-content {
        padding: 1rem;
    }
    
    .input-group {
        margin-bottom: 1rem;
    }
    
    .input-group label {
        font-size: 0.875rem;
    }
    
    .input-group input,
    .input-group select,
    .input-group textarea {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
    
    .allowances-section {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .allowances-section h3 {
        font-size: 1rem;
    }
    
    .allowance-item input {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    .results {
        padding: 1.5rem;
        margin-top: 1rem;
    }
    
    .results h4 {
        font-size: 1rem;
    }
    
    .results .amount {
        font-size: 1.75rem;
    }
    
    .results .breakdown {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .results .breakdown-item {
        padding: 0.75rem;
    }
    
    .results .breakdown-item h5 {
        font-size: 0.75rem;
    }
    
    .results .breakdown-item .value {
        font-size: 1.25rem;
    }
    
    .comparison-results {
        grid-template-columns: 1fr;
    }
    
    .comparison-card {
        padding: 1rem;
    }
    
    .comparison-card .total-cost {
        font-size: 1.5rem;
    }
    
    .comparison-chart {
        padding: 1rem;
    }
    
    /* Tools */
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .tool-card {
        padding: 1rem;
    }
    
    .tool-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .tool-card h3 {
        font-size: 1rem;
    }
    
    .tool-card p {
        font-size: 0.875rem;
    }
    
    /* Footer */
    .footer {
        padding: 2rem 0 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }
    
    .footer-section h3,
    .footer-section h4 {
        font-size: 1.125rem;
    }
    
    .footer-section p {
        font-size: 0.875rem;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .social-links a {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .footer-bottom {
        padding-top: 1.5rem;
    }
    
    .footer-bottom p {
        font-size: 0.875rem;
    }
    
    .disclaimer {
        font-size: 0.75rem;
    }
    
    /* Buttons */
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    .btn-sm {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
    
    /* Modal */
    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }
    
    .modal-header {
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }
    
    .modal-header h3 {
        font-size: 1.125rem;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    /* Tooltip */
    .tooltip .tooltip-text {
        width: 150px;
        margin-left: -75px;
        font-size: 0.75rem;
    }
    
    /* Alert */
    .alert {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    /* Badge */
    .badge {
        padding: 0.2rem 0.5rem;
        font-size: 0.7rem;
    }
}

/* Landscape Orientation for Small Screens */
@media (max-width: 767px) and (orientation: landscape) {
    .hero {
        padding: 1.5rem 0;
    }
    
    .hero h2 {
        font-size: 1.5rem;
    }
    
    .hero p {
        font-size: 0.875rem;
    }
    
    .hero-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .features,
    .calculator-section,
    .tools-section {
        padding: 2rem 0;
    }
    
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .feature-icon,
    .tool-icon {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    /* This can be expanded for dark mode support in the future */
    .modal {
        background-color: rgba(0, 0, 0, 0.7);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .hero::before {
        animation: none;
    }
    
    .results::before {
        animation: none;
    }
    
    .loading-spinner {
        animation: none;
    }
}

/* Print Styles */
@media print {
    * {
        background: transparent !important;
        color: black !important;
        text-shadow: none !important;
        box-shadow: none !important;
    }
    
    .header,
    .footer,
    .hero,
    .features,
    .tools-section,
    .modal {
        display: none !important;
    }
    
    .calculator-section {
        padding: 1rem 0;
    }
    
    .calculator-card {
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
    
    .results {
        background: #f5f5f5 !important;
        color: black !important;
        border: 1px solid #ccc;
    }
    
    .btn {
        display: none !important;
    }
    
    .tab-content {
        display: block !important;
    }
}