/* Contact Page Styles */
:root {
    --primary-color: #101010; /* kPrimaryColor from Flutter */
    --accent-color: #5ab78e;  /* The green accent color used in Flutter */
    --secondary-accent: #72B591;
}

.contact-section {
    position: relative;
    min-height: 100vh;
    background-color: #1D1D1C;
    color: #72B591;
    font-family: 'Arial', sans-serif;
    overflow: hidden;
}

.contact-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Background Elements */
.logo-top {
    position: absolute;
    top: 80px;
    left: 16px;
    max-height: 60px;
    z-index: 1;
}

.rtl .logo-top {
    left: auto;
    right: 16px;
}

.logo-top img {
    height: 40px;
    max-width: 50vw;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(62%) sepia(55%) saturate(342%) hue-rotate(101deg) brightness(92%) contrast(88%);
}

.logo-bottom {
    position: absolute;
    bottom: -16.67%;
    right: -7.14%;
    width: 50vw;
    z-index: 0;
}

.rtl .logo-bottom {
    right: auto;
    left: -7.14%;
}

.logo-bottom img {
    width: 100%;
    opacity: 0.2;
    filter: brightness(0) saturate(100%) invert(62%) sepia(55%) saturate(342%) hue-rotate(101deg) brightness(92%) contrast(88%);
}

.contact-brand-box {
    position: absolute;
    bottom: 40px;
    left: 40px;
    background-color: var(--accent-color);
    color: var(--primary-color);
    padding: 10px 60px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 16px;
    z-index: 1;
    transform: translateY(100px);
    opacity: 0;
    animation: slideUpFade 0.6s ease-out 0.5s forwards;
}

.rtl .contact-brand-box {
    left: auto;
    right: 40px;
}

@media (max-width: 699px) {
    .contact-brand-box {
        display: none;
    }
}

/* App Bar */
.contact-app-bar {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    padding: 16px;
    display: flex;
    justify-content: flex-end;
    z-index: 10;
}

.app-bar-actions {
    display: flex;
    gap: 8px;
}

.language-toggle,
.back-button {
    background: none;
    border: none;
    color: var(--accent-color);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.language-toggle:hover,
.back-button:hover {
    background-color: rgba(114, 181, 145, 0.1);
}

/* Contact Form */
.contact-form-wrapper {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    animation: fadeIn 0.8s ease-out;
}

.contact-form-container {
    padding: 16px;
}

.glass-panel {
    background-color: rgba(29, 29, 28, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.form-field-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    width: 100%;
}

@media (max-width: 767px) {
    .form-field-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

.form-field-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.contact-form label {
    color: var(--accent-color);
    font-size: 18px;
    white-space: nowrap;
    flex-shrink: 0; /* Prevents label from shrinking */
}

.contact-form input,
.contact-form textarea {
    flex: 1;
    width: 100%; /* Ensures the input takes full width of its container */
    min-width: 0; /* Prevents input from overflowing its container */
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 8px 0;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
    box-sizing: border-box; /* Ensures padding doesn't add to width */
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--accent-color);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: rgba(114, 181, 145, 0.2);
}

.form-field-row.focused label,
.form-field-column.focused label {
    color: var(--accent-color);
    transform: translateY(-5px);
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-submit {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.submit-button {
    background-color: var(--accent-color);
    color: var(--primary-color);
    border: none;
    border-radius: 4px;
    padding: 15px 36px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 260px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.submit-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.8s ease;
}

.submit-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(114, 181, 145, 0.3);
}

.submit-button:hover::before {
    transform: translateX(100%);
}

.submit-button.hovered {
    box-shadow: 0 8px 20px rgba(114, 181, 145, 0.4);
}

.button-line {
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.4s ease;
}

.button-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s ease, margin 0.4s ease;
    margin: 0;
}

.submit-button.loading {
    pointer-events: none;
}

.loader {
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

/* New Envelope Animation (based on Flutter implementation) */
.envelope-animation {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.envelope-animation.active {
    opacity: 1;
    transform: scale(1);
}

.envelope-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    margin-bottom: 24px;
    perspective: 1000px;
}

/* Base envelope */
.envelope-base {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Flap with pattern */
.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    perspective: 1000px;
}

.flap-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background-color: var(--accent-color);
    border-radius: 12px 12px 0 0;
    transform-origin: bottom;
    transform: rotateX(-45deg);
    transition: transform 0.7s ease;
    overflow: hidden;
    z-index: 2;
}

.flap-pattern::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/images/ffus.png');
    background-repeat: repeat;
}

.envelope-animation.active .flap-pattern {
    transform: rotateX(0deg);
}

/* Seal */
.envelope-seal {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 3;
}

.seal-circle {
    width: 50px;
    height: 50px;
    background-color: #1D1D1C;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.sender-info {
    width: 100%;
    max-width: 450px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.sender-logo {
    height: 40px;
    margin-right: 16px;
}

.sender-logo img {
    height: 100%;
    filter: brightness(0) saturate(100%) invert(62%) sepia(55%) saturate(342%) hue-rotate(101deg) brightness(92%) contrast(88%);
}

.sender-name {
    flex: 1;
    background-color: var(--accent-color);
    border-radius: 8px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
}

.from-label {
    color: var(--primary-color);
    font-weight: bold;
    margin-right: 8px;
}

.user-name {
    color: var(--primary-color);
}

/* Reset button */
.reset-button-container {
    margin-top: 24px;
}

.reset-button {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    background: transparent;
    color: var(--accent-color);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.reset-button:hover {
    background-color: rgba(90, 183, 142, 0.1);
}

.reset-button svg {
    margin-right: 8px;
}

/* Mobile contact brand box */
.mobile-contact-brand-box {
    margin-top: 10px;
    padding: 10px 60px;
    background-color: var(--accent-color);
    border-radius: 5px;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 16px;
    display: none;
}

@media (max-width: 699px) {
    .mobile-contact-brand-box {
        display: block;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 3D effects for envelope */
.envelope-base {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
    transform: translateZ(0);
}

.envelope-wrapper {
    transform-style: preserve-3d;
}

.flap-pattern {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transform-style: preserve-3d;
}
/* Toast Notification Styles */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 350px;
}

.rtl .toast-container {
    right: auto;
    left: 20px;
}

.toast {
    display: flex;
    align-items: center;
    background-color: #333;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: toast-in 0.3s ease-out forwards;
    opacity: 0;
    transform: translateY(-20px);
    overflow: hidden;
}

.toast-success {
    background-color: #5ab78e;
    color: #101010;
}

.toast-error {
    background-color: #e74c3c;
}

.toast-info {
    background-color: #3498db;
}

.toast-icon {
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rtl .toast-icon {
    margin-right: 0;
    margin-left: 12px;
}

.toast-message {
    flex-grow: 1;
    font-size: 14px;
    line-height: 1.4;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.7);
    animation: toast-progress 5s linear forwards;
}

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

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

@keyframes toast-progress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}


