﻿/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Times New Roman', Times, serif;
    background: linear-gradient(45deg, #1e3c72, #2a5298, #667eea, #764ba2);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

@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%;
    }
}

/* Floating Particles */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.1) 1px, transparent 1px), radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 1px, transparent 1px), radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.1) 1px, transparent 1px), radial-gradient(circle at 60% 60%, rgba(255, 255, 255, 0.1) 1px, transparent 1px), radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 1px, transparent 1px), radial-gradient(circle at 90% 80%, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 200px 200px, 300px 300px, 150px 150px, 250px 250px, 180px 180px, 220px 220px;
    animation: particleFloat 25s linear infinite;
    z-index: -2;
}

/* Geometric Shapes */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 45%, rgba(255, 255, 255, 0.03) 50%, transparent 55%), linear-gradient(-45deg, transparent 45%, rgba(255, 255, 255, 0.03) 50%, transparent 55%);
    background-size: 60px 60px;
    animation: geometricMove 20s ease-in-out infinite;
    z-index: -1;
}

@keyframes particleFloat {
    0% {
        transform: translateY(0px) translateX(0px) rotate(0deg);
    }

    25% {
        transform: translateY(-100px) translateX(50px) rotate(90deg);
    }

    50% {
        transform: translateY(-200px) translateX(-30px) rotate(180deg);
    }

    75% {
        transform: translateY(-150px) translateX(-80px) rotate(270deg);
    }

    100% {
        transform: translateY(0px) translateX(0px) rotate(360deg);
    }
}

@keyframes geometricMove {
    0%, 100% {
        transform: translateX(0) translateY(0) scale(1);
        opacity: 0.5;
    }

    33% {
        transform: translateX(20px) translateY(-20px) scale(1.1);
        opacity: 0.8;
    }

    66% {
        transform: translateX(-15px) translateY(15px) scale(0.9);
        opacity: 0.6;
    }
}

/* Additional Floating Elements */
.floating-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

    .floating-shapes::before,
    .floating-shapes::after {
        content: '';
        position: absolute;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.05);
        animation-timing-function: ease-in-out;
        animation-iteration-count: infinite;
        animation-direction: alternate;
    }

    .floating-shapes::before {
        width: 150px;
        height: 150px;
        top: 10%;
        left: 10%;
        animation: float1 8s infinite;
        box-shadow: 0 0 50px rgba(255, 255, 255, 0.1);
    }

    .floating-shapes::after {
        width: 100px;
        height: 100px;
        bottom: 20%;
        right: 15%;
        animation: float2 12s infinite;
        box-shadow: 0 0 40px rgba(255, 255, 255, 0.08);
    }

@keyframes float1 {
    0% {
        transform: translateY(0px) translateX(0px) scale(1);
        opacity: 0.3;
    }

    50% {
        transform: translateY(-50px) translateX(30px) scale(1.2);
        opacity: 0.6;
    }

    100% {
        transform: translateY(-100px) translateX(-20px) scale(0.8);
        opacity: 0.3;
    }
}

@keyframes float2 {
    0% {
        transform: translateY(0px) translateX(0px) rotate(0deg);
        opacity: 0.4;
    }

    50% {
        transform: translateY(60px) translateX(-40px) rotate(180deg);
        opacity: 0.7;
    }

    100% {
        transform: translateY(120px) translateX(20px) rotate(360deg);
        opacity: 0.4;
    }
}

/* Header Styles */
.text-center h1 {
    font-family: 'Times New Roman', Times, serif !important;
    font-weight: bold !important;
    color: #f8f9fa !important;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    animation: fadeInDown 1s ease-out;
    letter-spacing: 2px;
}

.text-center .lead {
    font-family: 'Times New Roman', Times, serif !important;
    color: #ffffff !important;
    font-size: 28px !important;
    margin-top: 20px !important;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease-out 0.3s both;
    font-weight: 300;
}

/* Login Container */
.login-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 50px 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.1);
    max-width: 450px;
    width: 100%;
    margin: 60px auto;
    position: relative;
    animation: slideInUp 0.8s ease-out 0.5s both;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

    .login-container::before {
        content: '';
        position: absolute;
        top: -2px;
        left: -2px;
        right: -2px;
        bottom: -2px;
        background: linear-gradient(45deg, #667eea, #764ba2, #667eea);
        border-radius: 22px;
        z-index: -1;
        animation: borderGlow 3s ease-in-out infinite;
    }

@keyframes borderGlow {
    0%, 100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* Title Styles */
.ttl {
    color: #2c3e50;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 40px;
    position: relative;
    text-align: center;
}

    .ttl::after {
        content: '';
        position: absolute;
        bottom: -10px;
        left: 50%;
        transform: translateX(-50%);
        width: 80px;
        height: 3px;
        background: linear-gradient(45deg, #667eea, #764ba2);
        border-radius: 2px;
        animation: expandLine 1s ease-out 1s both;
    }

@keyframes expandLine {
    from {
        width: 0;
    }

    to {
        width: 80px;
    }
}

/* Form Styles */
.form-label {
    color: #2c3e50;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
    display: block;
}

/* Input Group Styles */
.input-group {
    position: relative;
    margin-bottom: 25px;
}

.input-group-text {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border: none;
    color: white;
    border-radius: 12px 0 0 12px;
    padding: 12px 15px;
    transition: all 0.3s ease;
}

.form-control {
    border: 2px solid #e1e8ed;
    border-left: none;
    border-radius: 0 12px 12px 0;
    padding: 12px 15px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

    .form-control:focus {
        border-color: #667eea;
        box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
        background: white;
        outline: none;
    }

.input-group:hover .input-group-text {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.input-group:hover .form-control {
    border-color: #667eea;
}

/* Button Styles */
.btn-success {
    background: linear-gradient(45deg, #28a745, #20c997);
    border: none;
    border-radius: 12px;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 30px !important;
}

    .btn-success::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
        transition: left 0.6s;
    }

    .btn-success:hover::before {
        left: 100%;
    }

    .btn-success:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 25px rgba(40, 167, 69, 0.4);
        background: linear-gradient(45deg, #218838, #1e7e34);
    }

    .btn-success:active {
        transform: translateY(-1px);
        box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
    }

/* Icon Animation */
.bi {
    transition: all 0.3s ease;
}

.input-group:hover .bi {
    transform: rotate(360deg) scale(1.1);
}

.btn-success .bi {
    margin-left: 10px;
    transition: all 0.3s ease;
}

.btn-success:hover .bi {
    transform: translateX(5px);
}

/* Validation Styles */
.text-danger {
    color: #dc3545 !important;
    font-size: 14px;
    margin-top: 5px;
    display: block;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* Modal Styles */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    animation: modalSlideIn 0.3s ease-out;
}

.modal-header {
    background: linear-gradient(45deg, #dc3545, #c82333);
    color: white;
    border-radius: 15px 15px 0 0;
    border-bottom: none;
}

.modal-title {
    font-weight: 600;
}

.modal-body {
    padding: 30px;
    color: #2c3e50;
    font-weight: 500;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 15px 15px;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(60px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-container {
        margin: 30px 20px;
        padding: 40px 30px;
        max-width: 100%;
    }

    .text-center h1 {
        font-size: 2.5rem;
    }

    .text-center .lead {
        font-size: 22px !important;
    }

    .ttl {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .login-container {
        margin: 20px 15px;
        padding: 30px 25px;
    }

    .text-center h1 {
        font-size: 2rem;
        letter-spacing: 1px;
    }

    .text-center .lead {
        font-size: 20px !important;
    }

    .ttl {
        font-size: 24px;
    }
}

/* Loading Animation for Button */
.btn-success.loading {
    pointer-events: none;
    position: relative;
}

    .btn-success.loading::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 20px;
        height: 20px;
        margin: -10px 0 0 -10px;
        border: 2px solid #ffffff;
        border-top: 2px solid transparent;
        border-radius: 50%;
        animation: buttonSpin 1s linear infinite;
    }

@keyframes buttonSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Focus States for Accessibility */
.form-control:focus,
.btn-success:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Hover Effects for Touch Devices */
@media (hover: none) and (pointer: coarse) {
    .input-group:hover .input-group-text,
    .input-group:hover .form-control {
        transform: none;
        box-shadow: none;
        border-color: #e1e8ed;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .login-container {
        background: white;
        border: 2px solid #000;
    }

    .form-control {
        border: 2px solid #000;
    }

    .btn-success {
        background: #000;
        border: 2px solid #000;
    }
}
