/* public/CSS/home.css */

body {
    background: var(--primary-color);
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#particles-js {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* NEW: Floating Words Container */
.floating-words-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.floating-words-container .word {
    position: absolute;
    right: -150px; /* Start off-screen to the right */
    font-size: clamp(2rem, 5vw, 6rem);
    font-weight: bold;
    color: var(--secondary-color);
    opacity: 0;
    white-space: nowrap;
    animation: float-left var(--duration, 20s) linear infinite;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    font-family: 'Cairo', sans-serif;
    pointer-events: auto; /* Enable hover for words */
    transition: transform 0.2s ease-in-out; /* Add transition for hover effect */
}

/* New Wave Effect on Hover */
.floating-words-container .word:hover {
    transform: scale(1.1) translateY(-10px);
    opacity: 0.5 !important;
}

@keyframes float-left {
    0% {
        transform: translateX(0);
        opacity: 0;
    }
    10% {
        opacity: var(--opacity, 0.1);
    }
    80% {
        opacity: var(--opacity, 0.1);
    }
    100% {
        transform: translateX(calc(-100vw - 150px)); /* End off-screen to the left */
        opacity: 0;
    }
}

.floating-words-container .word:nth-child(1) { top: 10%; animation-delay: 0s; --duration: 15s; --opacity: 0.05; }
.floating-words-container .word:nth-child(2) { top: 30%; animation-delay: 1.5s; --duration: 18s; --opacity: 0.08; }
.floating-words-container .word:nth-child(3) { top: 50%; animation-delay: 3s; --duration: 21s; --opacity: 0.07; }
.floating-words-container .word:nth-child(4) { top: 70%; animation-delay: 4.5s; --duration: 16s; --opacity: 0.06; }
.floating-words-container .word:nth-child(5) { top: 85%; animation-delay: 6s; --duration: 19s; --opacity: 0.09; }
.floating-words-container .word:nth-child(6) { top: 20%; animation-delay: 7.5s; --duration: 22s; --opacity: 0.07; }
.floating-words-container .word:nth-child(7) { top: 40%; animation-delay: 9s; --duration: 18s; --opacity: 0.06; }
.floating-words-container .word:nth-child(8) { top: 60%; animation-delay: 10.5s; --duration: 20s; --opacity: 0.08; }
.floating-words-container .word:nth-child(9) { top: 90%; animation-delay: 12s; --duration: 15s; --opacity: 0.05; }
.floating-words-container .word:nth-child(10) { top: 5%; animation-delay: 13.5s; --duration: 18s; --opacity: 0.07; }
.floating-words-container .word:nth-child(11) { top: 25%; animation-delay: 15s; --duration: 20s; --opacity: 0.06; }
.floating-words-container .word:nth-child(12) { top: 45%; animation-delay: 16.5s; --duration: 17s; --opacity: 0.08; }
.floating-words-container .word:nth-child(13) { top: 65%; animation-delay: 18s; --duration: 20s; --opacity: 0.05; }


.container {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.card {
    background: rgba(26, 26, 26, 0.9);
    backdrop-filter: blur(5px);
    border-radius: 15px;
    padding: 2.5rem;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    animation: fade-in 1s ease-out;
    border: 1px solid #333;
}

.logo-text {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.3);
}

.slogan {
    color: #aaa;
    margin-bottom: 2rem;
    font-size: 1rem;
}

#forgot-password-link, #back-to-login {
    display: block;
    margin-top: 1rem;
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

#forgot-password-link:hover, #back-to-login:hover {
    color: var(--text-color);
    text-decoration: underline;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.btn-login {
    position: relative;
    overflow: hidden;
}

.btn-login .btn-text,
.btn-login .btn-icon {
    transition: opacity 0.3s ease;
}

.btn-login.loading .btn-text,
.btn-login.loading .btn-icon {
    opacity: 0;
}

.button-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.btn-login.loading .button-spinner {
    display: block;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Modal and error message styles (copied from dashboard.css) */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

.modal-content.compact-state {
    max-width: 400px;
    min-height: auto;
    max-height: auto;
    height: fit-content;
    width: fit-content;
    margin: 15% auto; /* Adjusted for better centering */
}

.modal-header {
    padding: 1.5rem 2rem 1rem 2rem;
    border-bottom: 2px solid var(--error-color);
    flex-shrink: 0;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    color: #aaa;
    position: static; /* Changed from absolute */
    font-size: 28px;
    font-weight: bold;
    z-index: 10;
}

.close-btn:hover,
.close-btn:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

.modal-title.error-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--error-color);
    margin: 0;
}

.modal-title.error-title i {
    margin-right: 10px;
    font-size: 1.5rem;
}

.modal-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1.5rem 2rem;
}

.error-container {
    color: var(--error-color);
    background-color: transparent;
    border-left: none;
    padding: 0;
    margin: 0;
    border-radius: 0;
    display: none;
    flex-shrink: 0;
}

.error-container ul {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}

.error-container li {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* NEW: Styles for the password requirement list */
.req-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    text-align: left;
    font-size: 0.9rem;
}

.req-list li {
    color: #999;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.req-list li.valid {
    color: var(--success-color);
}

.req-list li.valid .fa-times-circle {
    display: none;
}

.req-list li.valid::before {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: var(--success-color);
    margin-right: 8px;
}

.req-list li .fa-times-circle {
    color: var(--error-color);
    margin-right: 8px;
}

/* NEW: Resend Button Style */
.btn-resend {
  display: inline-block;
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--secondary-color);
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.3s ease;
  background-color: transparent;
  color: var(--secondary-color);
  position: relative;
  overflow: hidden;
  margin-top: 1rem;
}

.btn-resend:hover {
  background-color: rgba(255, 215, 0, 0.1);
  transform: translateY(-2px);
}

.btn-resend.loading {
  background-color: #333 !important;
  color: #666;
  cursor: not-allowed;
  transform: none;
  border-color: #444 !important;
}

.btn-resend.loading .btn-text,
.btn-resend.loading .btn-icon {
  opacity: 0;
}

.btn-resend .button-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.btn-resend.loading .button-spinner {
    display: block;
}

/* NEW: Style for the button group container */
.button-group {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  width: 100%;
  margin-top: 1rem;
}

.button-group .btn {
    width: fit-content;
    max-width: 250px;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
}

.button-group .btn-login {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.button-group .btn-login:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.btn-resend {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.btn-resend:hover {
    background-color: var(--border-color);
    color: var(--secondary-color);
}

.otp-error-message {
    text-align: center;
    color: var(--error-color);
    font-weight: bold;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: -1rem;
    margin-bottom: 1rem;
}

/* Styles for invalid OTP state */
.verification-code-group.invalid .verification-code-input {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.2);
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% {
        transform: translate3d(-1px, 0, 0);
    }
    20%, 80% {
        transform: translate3d(2px, 0, 0);
    }
    30%, 50%, 70% {
        transform: translate3d(-4px, 0, 0);
    }
    40%, 60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* NEW: Styles for the advanced OTP inputs */
.verification-code-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.verification-code-input {
    width: 50px; /* Adjust size as needed */
    height: 50px;
    font-size: 1.5rem;
    text-align: center;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: #222;
    color: var(--text-color);
    caret-color: var(--secondary-color);
    transition: all 0.3s ease;
    font-weight: bold;
}

.verification-code-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
    transform: scale(1.1);
}

/* Add a new, advanced shake animation for a more polished look */
.verification-code-group.invalid .verification-code-input {
    border-color: var(--error-color) !important;
    animation: advanced-shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes advanced-shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}