﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #000000 0%, #1a1a2e 25%, #16213e 50%, #0f3460 75%, #000000 100%);
    background-size: 400% 400%;
    animation: gradientShift 8s ease-in-out infinite;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    direction: rtl;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    25% {
        background-position: 100% 50%;
    }

    50% {
        background-position: 100% 100%;
    }

    75% {
        background-position: 0% 100%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Override Bootstrap container for login form */
.container {
    width: 100% !important;
    max-width: 400px !important;
    padding: 20px !important;
    margin: 0 auto !important;
}

.login-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 40px 30px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
    width: 100% !important;
}

    .login-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, #95a5a6 0%, #7f8c8d 50%, #2c3e50 100%);
    }

.logo-section {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    max-width: 150px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100% !important;
}

.form-group {
    position: relative;
    width: 100% !important;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100% !important;
}

.input-icon {
    position: absolute;
    right: 15px;
    color: #2c3e50;
    font-size: 16px;
    z-index: 2;
}

.form-input,
.form-select {
    width: 100% !important;
    padding: 15px 45px 15px 15px !important;
    border: 2px solid #e1e5e9 !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    transition: all 0.3s ease;
    background: white !important;
    color: #333 !important;
    box-sizing: border-box !important;
}

    .form-input:focus,
    .form-select:focus {
        outline: none !important;
        border-color: #34495e !important;
        box-shadow: 0 0 0 3px rgba(52, 73, 94, 0.15) !important;
        transform: translateY(-2px);
    }

    .form-input::placeholder {
        color: #999;
        font-size: 14px;
    }

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%232c3e50' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 15px center;
    background-size: 16px;
}

/* Override Bootstrap button styles for login form */
.login-form .btn {
    width: 100% !important;
    padding: 15px !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px;
    text-decoration: none;
    box-sizing: border-box !important;
}

.btn-primary {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%) !important;
    color: white !important;
    box-shadow: 0 8px 20px rgba(52, 73, 94, 0.3);
    font-weight: 600;
    letter-spacing: 0.5px;
}

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 25px rgba(52, 73, 94, 0.4);
        background: linear-gradient(135deg, #5d6d7e 0%, #34495e 100%) !important;
    }

    .btn-primary:active {
        transform: translateY(0);
    }

.btn-info {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%) !important;
    color: white !important;
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.3);
    font-weight: 600;
    letter-spacing: 0.5px;
}

    .btn-info:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 25px rgba(52, 152, 219, 0.4);
        background: linear-gradient(135deg, #5dade2 0%, #3498db 100%) !important;
    }

    .btn-info:active {
        transform: translateY(0);
    }

.forgot-password {
    text-align: center;
    color: #34495e;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: block;
    margin-top: 10px;
}

    .forgot-password:hover {
        color: #2c3e50;
        text-decoration: underline;
    }

/* Animation for form elements */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group {
    animation: fadeInUp 0.6s ease forwards;
}

    .form-group:nth-child(1) {
        animation-delay: 0.1s;
    }

    .form-group:nth-child(2) {
        animation-delay: 0.2s;
    }

    .form-group:nth-child(3) {
        animation-delay: 0.3s;
    }

    .form-group:nth-child(4) {
        animation-delay: 0.4s;
    }

    .form-group:nth-child(5) {
        animation-delay: 0.5s;
    }

    .form-group:nth-child(6) {
        animation-delay: 0.6s;
    }

    .form-group:nth-child(7) {
        animation-delay: 0.7s;
    }

/* Responsive design */
@media (max-width: 480px) {
    .container {
        padding: 10px !important;
    }

    .login-card {
        padding: 30px 20px;
    }

    .form-input,
    .form-select {
        padding: 12px 40px 12px 12px !important;
        font-size: 13px !important;
    }

    .login-form .btn {
        padding: 12px !important;
        font-size: 15px !important;
    }

    /* Modal responsive design */
    .modal-dialog {
        margin: 10px !important;
    }

    .modal-content {
        border-radius: 12px !important;
    }

    .modal-body {
        padding: 20px !important;
    }

    .modal-form-control {
        padding: 12px 40px 12px 12px !important;
        font-size: 13px !important;
    }

    .modal-input-icon {
        font-size: 14px !important;
        right: 12px !important;
    }

    html[dir="ltr"] .modal-input-icon {
        left: 12px !important;
    }

    .modal-footer .btn {
        padding: 10px 20px !important;
        font-size: 14px !important;
    }
}

/* Loading state for button */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

    .btn.loading i {
        animation: spin 1s linear infinite;
    }

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Error states */
.form-input.error {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1) !important;
}

.error-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.form-input.error + .error-message {
    display: block;
}

/* Password error label */
.error-label {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
    border: 1px solid rgba(231, 76, 60, 0.2);
    animation: shake 0.5s ease-in-out;
}

    .error-label i {
        font-size: 16px;
        color: #fff;
    }

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* Language direction support */
html[dir="ltr"] {
    direction: ltr;
}

    html[dir="ltr"] .input-icon {
        right: auto;
        left: 15px;
    }

    html[dir="ltr"] .form-input,
    html[dir="ltr"] .form-select {
        padding: 15px 15px 15px 45px !important;
    }

    html[dir="ltr"] .form-select {
        background-position: right 15px center;
    }

/* Bootstrap Modal Customization */
.modal-content {
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
}

.modal-header {
    border-bottom: 1px solid #e1e5e9;
    padding: 20px 30px;
}

.modal-title {
    color: #2c3e50;
    font-weight: 600;
    font-size: 18px;
    margin: 0;
}

.control-label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    margin-bottom: 8px;
    display: block;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    border-top: 1px solid #e1e5e9;
    padding: 20px 30px;
}

/* Form Controls in Modal - Same style as login form */
.control-group {
    margin-bottom: 20px;
    position: relative;
    width: 100% !important;
}

.control-label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    margin-bottom: 8px;
    display: block;
}

/* Modal input wrapper - same as login form */
.modal-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100% !important;
}

.modal-input-icon {
    position: absolute;
    right: 15px;
    color: #2c3e50;
    font-size: 16px;
    z-index: 2;
}

/* Modal form controls - same style as login form inputs */
.modal-form-control {
    width: 100% !important;
    padding: 15px 45px 15px 15px !important;
    border: 2px solid #e1e5e9 !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    transition: all 0.3s ease;
    background: white !important;
    color: #333 !important;
    box-sizing: border-box !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

    .modal-form-control:focus {
        outline: none !important;
        border-color: #34495e !important;
        box-shadow: 0 0 0 3px rgba(52, 73, 94, 0.15) !important;
        transform: translateY(-2px);
    }

    .modal-form-control::placeholder {
        color: #999;
        font-size: 14px;
    }

/* Focus effects for modal inputs */
.modal-input-wrapper.focused .modal-form-control {
    border-color: #34495e !important;
    box-shadow: 0 0 0 3px rgba(52, 73, 94, 0.15) !important;
}

.modal-input-wrapper.focused .modal-input-icon {
    color: #34495e;
}

/* Error states for modal inputs */
.modal-form-control.error {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1) !important;
}

.modal-error-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.modal-form-control.error + .modal-error-message {
    display: block;
}

/* Keep original form-control for backward compatibility */
.form-control {
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 14px;
    transition: all 0.3s ease;
}

    .form-control:focus {
        border-color: #34495e;
        box-shadow: 0 0 0 3px rgba(52, 73, 94, 0.15);
    }

/* Language direction support for modal */
html[dir="ltr"] .modal-footer {
    justify-content: flex-start;
}

html[dir="ltr"] .modal-header {
    flex-direction: row-reverse;
}

/* Language direction support for modal inputs */
html[dir="ltr"] .modal-input-icon {
    right: auto;
    left: 15px;
}

html[dir="ltr"] .modal-form-control {
    padding: 15px 15px 15px 45px !important;
}

/* Modal button improvements */
.modal-footer .btn {
    border-radius: 12px !important;
    padding: 12px 24px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    border: none !important;
}

.modal-footer .btn-secondary {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(149, 165, 166, 0.3) !important;
}

    .modal-footer .btn-secondary:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 16px rgba(149, 165, 166, 0.4) !important;
    }

.modal-footer .btn-success {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3) !important;
}

    .modal-footer .btn-success:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 16px rgba(39, 174, 96, 0.4) !important;
    }
