/**
 * Apple-Inspired Login Page Styles with Glass Effect and Animated Icons
 * Enhanced for SAMPARK - Railway Grievance System
 */

/* Remove default body styles for login page */
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

/* Animated Freight Service Icons Background */
.freight-icons-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.freight-icon {
    position: absolute;
    color: rgba(0, 136, 204, 0.08);
    font-size: clamp(2rem, 5vw, 4rem);
    animation-duration: 15s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
    will-change: transform, opacity;
    transition: opacity 0.3s ease;
}

/* Enhanced Icon Positioning for More Coverage */
.freight-icon-1 {
    top: 5%;
    left: 8%;
    animation: floatRight 20s infinite;
    animation-delay: 0s;
}

.freight-icon-2 {
    top: 15%;
    right: 12%;
    animation: floatLeft 18s infinite;
    animation-delay: -2s;
}

.freight-icon-3 {
    top: 25%;
    left: 25%;
    animation: floatUp 22s infinite;
    animation-delay: -4s;
}

.freight-icon-4 {
    top: 35%;
    right: 25%;
    animation: floatDown 16s infinite;
    animation-delay: -6s;
}

.freight-icon-5 {
    top: 45%;
    left: 15%;
    animation: rotate 25s infinite;
    animation-delay: -8s;
}

.freight-icon-6 {
    top: 55%;
    right: 35%;
    animation: pulse 12s infinite;
    animation-delay: -10s;
}

.freight-icon-7 {
    top: 65%;
    left: 40%;
    animation: floatRight 24s infinite;
    animation-delay: -12s;
}

.freight-icon-8 {
    top: 75%;
    right: 20%;
    animation: floatLeft 19s infinite;
    animation-delay: -14s;
}

.freight-icon-9 {
    top: 85%;
    left: 60%;
    animation: floatUp 21s infinite;
    animation-delay: -16s;
}

.freight-icon-10 {
    top: 10%;
    left: 45%;
    animation: floatDown 17s infinite;
    animation-delay: -18s;
}

.freight-icon-11 {
    top: 20%;
    right: 45%;
    animation: rotate 23s infinite;
    animation-delay: -20s;
}

.freight-icon-12 {
    top: 30%;
    left: 70%;
    animation: pulse 14s infinite;
    animation-delay: -22s;
}

.freight-icon-13 {
    top: 40%;
    right: 5%;
    animation: floatRight 26s infinite;
    animation-delay: -24s;
}

.freight-icon-14 {
    top: 50%;
    left: 5%;
    animation: floatLeft 20s infinite;
    animation-delay: -26s;
}

.freight-icon-15 {
    top: 60%;
    right: 50%;
    animation: floatUp 18s infinite;
    animation-delay: -28s;
}

.freight-icon-16 {
    top: 70%;
    left: 80%;
    animation: floatDown 15s infinite;
    animation-delay: -30s;
}

.freight-icon-17 {
    top: 80%;
    right: 60%;
    animation: rotate 27s infinite;
    animation-delay: -32s;
}

.freight-icon-18 {
    top: 90%;
    left: 30%;
    animation: pulse 13s infinite;
    animation-delay: -34s;
}

@keyframes floatRight {
    0%, 100% { transform: translateX(0) translateY(0) rotate(0deg); opacity: 0.3; }
    25% { transform: translateX(50px) translateY(-30px) rotate(90deg); opacity: 0.6; }
    50% { transform: translateX(100px) translateY(0) rotate(180deg); opacity: 0.8; }
    75% { transform: translateX(50px) translateY(30px) rotate(270deg); opacity: 0.6; }
}

@keyframes floatLeft {
    0%, 100% { transform: translateX(0) translateY(0) rotate(0deg); opacity: 0.4; }
    25% { transform: translateX(-30px) translateY(40px) rotate(-90deg); opacity: 0.7; }
    50% { transform: translateX(-60px) translateY(0) rotate(-180deg); opacity: 0.9; }
    75% { transform: translateX(-30px) translateY(-40px) rotate(-270deg); opacity: 0.7; }
}

@keyframes floatUp {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.2; }
    50% { transform: translateY(-80px) scale(1.2); opacity: 0.6; }
}

@keyframes floatDown {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.3; }
    50% { transform: translateY(60px) scale(0.8); opacity: 0.8; }
}

@keyframes rotate {
    0% { transform: rotate(0deg) scale(1); opacity: 0.2; }
    50% { transform: rotate(180deg) scale(1.1); opacity: 0.5; }
    100% { transform: rotate(360deg) scale(1); opacity: 0.2; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

/* Main Login Container */
.login-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Split Screen Layout - Wider and Shorter */
.login-split-screen {
    display: flex;
    width: 100%;
    max-width: 1600px;
    height: 70vh;
    min-height: 600px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Left Side - Image with Glass Effect */
.login-image-side {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.image-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.login-background-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: brightness(1.1) contrast(1.05) saturate(1.1);
}

/* Glass Overlay Effect */
.image-glass-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.25) 0%,
        rgba(255, 255, 255, 0.15) 25%,
        rgba(0, 136, 204, 0.2) 50%,
        rgba(0, 136, 204, 0.3) 75%,
        rgba(0, 0, 0, 0.4) 100%
    );
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: glassShimmer 8s ease-in-out infinite;
}

@keyframes glassShimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Glass Content */
.glass-content {
    text-align: center;
    color: white;
    padding: 40px;
    max-width: 500px;
    animation: fadeInUp 1.2s ease-out;
}

/* SAMPARK Logo Container */
.sampark-logo-container {
    margin-bottom: 30px;
    animation: logoFadeIn 1.5s ease-out 0.2s both;
}

.sampark-welcome-logo {
    width: clamp(80px, 15vw, 120px);
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.sampark-welcome-logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.4));
}

@keyframes logoFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-title {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 300;
    margin-bottom: 0;
    letter-spacing: -0.022em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    animation: slideInLeft 1s ease-out 0.3s both;
}

.system-title {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 700;
    margin: 10px 0 20px 0;
    letter-spacing: -0.022em;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    background: linear-gradient(45deg, #ffffff, #e2e8f0, #ffffff);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textGradientShift 4s ease-in-out infinite, slideInRight 1s ease-out 0.6s both;
}

@keyframes textGradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes slideInLeft {
    0% {
        opacity: 0;
        transform: translateX(-50px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(50px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.system-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    font-weight: 400;
    margin-bottom: 40px;
    opacity: 0.9;
    letter-spacing: -0.022em;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    animation: fadeIn 1s ease-out 0.9s both;
}

.customer-login-subtitle {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: 500;
    margin: 10px 0 0 0;
    opacity: 0.9;
    letter-spacing: -0.022em;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    animation: fadeIn 1s ease-out 1.1s both;
    background: rgba(0, 136, 204, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 0.9; }
}

/* Feature Highlights */
.feature-highlights {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 40px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation: slideInUp 0.8s ease-out calc(1.2s + var(--delay, 0s)) both;
}

.feature-item:nth-child(1) { --delay: 0s; }
.feature-item:nth-child(2) { --delay: 0.2s; }
.feature-item:nth-child(3) { --delay: 0.4s; }

@keyframes slideInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(10px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.feature-item i {
    font-size: 1.5rem;
    color: #0088cc;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.feature-item span {
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: -0.022em;
}

/* Right Side - Login Form */
.login-form-side {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
}

.login-form-container {
    width: 100%;
    max-width: 400px;
    animation: slideInRight 1s ease-out 0.5s both;
}

/* Login Header */
.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--apple-black, #000000);
    margin-bottom: 10px;
    letter-spacing: -0.022em;
    line-height: 1.2;
}

.login-subtitle {
    font-size: 1.1rem;
    color: var(--apple-dark-gray, #666666);
    margin: 0;
    font-weight: 400;
    letter-spacing: -0.022em;
}

/* Form Styles */
.login-form {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--apple-black, #000000);
    margin-bottom: 8px;
    letter-spacing: -0.022em;
}

.form-label i {
    margin-right: 8px;
    color: var(--apple-blue, #0088cc);
    width: 16px;
    text-align: center;
}

.form-control {
    width: 100%;
    padding: 16px 20px;
    font-size: 17px;
    line-height: 1.47059;
    letter-spacing: -0.022em;
    color: var(--apple-black, #000000);
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--apple-blue, #0088cc);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 4px rgba(0, 136, 204, 0.15);
}

.form-control::placeholder {
    color: var(--apple-medium-gray, #979797);
    opacity: 0.8;
}

/* Password Input Container */
.password-input-container {
    position: relative;
}

.password-input-container .form-control {
    padding-right: 50px;
}

.password-toggle-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--apple-medium-gray, #979797);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: 4px;
}

.password-toggle-btn:hover {
    color: var(--apple-blue, #0088cc);
    background: rgba(0, 136, 204, 0.1);
}

.password-toggle-btn:focus {
    outline: 2px solid var(--apple-blue, #0088cc);
    outline-offset: 2px;
}

.password-toggle-btn i {
    font-size: 16px;
}

/* Login Button */
.btn-login {
    width: 100%;
    padding: 16px 24px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.022em;
    color: white;
    background: var(--apple-blue, #0088cc);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 56px;
    box-shadow: 0 4px 16px rgba(0, 136, 204, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    background: #007acc;
    box-shadow: 0 8px 24px rgba(0, 136, 204, 0.4), 0 4px 12px rgba(0, 136, 204, 0.2);
}

.btn-login:active {
    box-shadow: 0 4px 16px rgba(0, 136, 204, 0.3);
}

.btn-text {
    font-size: 17px;
    font-weight: 600;
}

.btn-icon {
    font-size: 16px;
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.btn-login:hover .btn-icon {
    transform: translateX(4px);
}

/* Login Footer */
.login-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.help-text {
    font-size: 15px;
    color: var(--apple-dark-gray, #666666);
    margin: 0;
    letter-spacing: -0.022em;
    line-height: 1.4;
}

.help-text i {
    margin-right: 8px;
    color: var(--apple-blue, #0088cc);
}

/* Login Links */
.login-links {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.login-links .btn {
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    letter-spacing: -0.022em;
}

.login-links .btn-outline-primary {
    color: var(--apple-blue, #0088cc);
    border-color: var(--apple-blue, #0088cc);
}

.login-links .btn-outline-primary:hover {
    background-color: var(--apple-blue, #0088cc);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.3);
}

.login-links .btn-outline-secondary {
    color: var(--apple-dark-gray, #666666);
    border-color: var(--apple-dark-gray, #666666);
}

.login-links .btn-outline-secondary:hover {
    background-color: var(--apple-dark-gray, #666666);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 102, 102, 0.3);
}

.login-links .btn i {
    margin-right: 6px;
}

/* Responsive Design - Optimized for Wider Layout */
@media (max-width: 1200px) {
    .login-split-screen {
        max-width: 1200px;
        height: 75vh;
    }
}

@media (max-width: 1024px) {
    .login-split-screen {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        max-width: 100%;
    }
    
    .login-image-side {
        min-height: 35vh;
    }
    
    .glass-content {
        padding: 20px;
    }
    
    .feature-highlights {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .feature-item {
        flex: 1;
        min-width: 150px;
        padding: 10px 15px;
    }
    
    /* Optimize icons for smaller screens */
    .freight-icon {
        font-size: clamp(2.5rem, 6vw, 4rem);
    }
}

@media (max-width: 768px) {
    .login-container {
        padding: 10px;
    }
    
    .login-split-screen {
        border-radius: 16px;
        min-height: 100vh;
    }
    
    .login-image-side {
        min-height: 35vh;
    }
    
    .login-form-side {
        padding: 40px 20px;
    }
    
    .login-title {
        font-size: 2rem;
    }
    
    .system-title {
        font-size: 3rem;
    }
    
    .welcome-title {
        font-size: 1.3rem;
    }
    
    .feature-highlights {
        flex-direction: column;
        gap: 15px;
    }
    
    .freight-icon {
        font-size: 4rem;
    }
}

@media (max-width: 480px) {
    .login-form-side {
        padding: 30px 15px;
    }
    
    .login-form-container {
        max-width: 100%;
    }
    
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 14px 16px;
    }
    
    .password-input-container .form-control {
        padding-right: 45px;
    }
    
    .password-toggle-btn {
        right: 12px;
        width: 20px;
        height: 20px;
    }
    
    .password-toggle-btn i {
        font-size: 14px;
    }
    
    .btn-login {
        font-size: 16px;
        padding: 14px 20px;
        min-height: 48px;
    }
    
    .system-title {
        font-size: 2.5rem;
    }
    
    .glass-content {
        padding: 15px;
    }
    
    .sampark-welcome-logo {
        width: clamp(60px, 12vw, 80px);
    }
    
    .sampark-logo-container {
        margin-bottom: 20px;
    }
    
    .freight-icon {
        font-size: 3rem;
    }
}

/* Loading Animation */
.btn-login.loading {
    pointer-events: none;
}

.btn-login.loading .btn-text {
    opacity: 0;
}

.btn-login.loading .btn-icon {
    animation: spin 1s linear infinite;
}

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

/* Alert Container for Standalone Login Page */
.alert-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 90%;
    max-width: 500px;
}

/* Alert Overrides for Login Page */
.alert {
    border-radius: 12px;
    border: none;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    margin-bottom: 0;
    animation: slideInDown 0.5s ease-out;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
}

@keyframes slideInDown {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    .freight-icon,
    .glass-content,
    .login-form-container,
    .feature-item,
    .alert {
        animation: none;
    }
    
    .btn-login::before {
        display: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .form-control {
        border: 2px solid #000;
    }
    
    .btn-login {
        background: #000;
        border: 2px solid #000;
    }
    
    .image-glass-overlay {
        background: rgba(0, 0, 0, 0.7);
    }
}

/* Print Styles */
@media print {
    .freight-icons-background,
    .login-image-side {
        display: none;
    }
    
    .login-split-screen {
        flex-direction: column;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .login-form-side {
        background: white;
    }
}
}