* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body { 
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif; 
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 25%, #16213e 50%, #0f3460 75%, #533483 100%);
    min-height: 100vh;
    color: #ffffff;
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 107, 157, 0.1) 0%, transparent 60%),
        radial-gradient(circle at 80% 20%, rgba(142, 68, 173, 0.1) 0%, transparent 60%),
        radial-gradient(circle at 40% 40%, rgba(196, 69, 105, 0.08) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
    animation: gradientShift 15s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: rgba(20, 20, 20, 0.6);
    backdrop-filter: blur(20px);
    box-shadow: 
        0 25px 50px rgba(0,0,0,0.6),
        0 15px 35px rgba(255, 107, 157, 0.2),
        0 5px 15px rgba(142, 68, 173, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
    border: 1px solid rgba(255, 107, 157, 0.3);
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
    padding-top: 20px; /* Add padding at the top since we removed the header */
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, #ff6b9d, #c44569, #8e44ad, #9b59b6, #ff6b9d);
    z-index: -1;
    animation: borderGlow 3s ease-in-out infinite;
}

@keyframes borderGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

/* Page title to replace header */
.page-title {
    text-align: center;
    margin-bottom: 30px;
}

.page-title h2 {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 107, 157, 0.5);
    background: linear-gradient(135deg, #ff6b9d 0%, #e91e63 50%, #9b59b6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    padding: 10px 20px;
    border-radius: 15px;
    position: relative;
    z-index: 5;
}

/* Fix: Ensure icons/emojis in .page-title h2 show native color, not gradient */
.page-title h2 .emoji,
.page-title h2 [role="img"],
.page-title h2 i,
.page-title h2 svg {
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    -webkit-text-fill-color: initial !important;
    color: initial !important;
    filter: none !important;
    text-shadow: none !important;
}

.header {
    background: linear-gradient(135deg, #ff6b9d 0%, #e91e63 25%, #c44569 50%, #8e44ad 75%, #9b59b6 100%);
    background-size: 300% 300%;
    color: white;
    padding: 50px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: headerGradient 4s ease-in-out infinite;
    border-bottom: 3px solid rgba(255, 107, 157, 0.3);
    box-shadow: 
        0 8px 32px rgba(255, 107, 157, 0.3),
        0 0 60px rgba(255, 107, 157, 0.1);
}

@keyframes headerGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.1) 75%);
    background-size: 30px 30px;
    opacity: 0.3;
    animation: float 20s linear infinite;
}

@keyframes float {
    0% { transform: translateX(0px) translateY(0px); }
    25% { transform: translateX(10px) translateY(-5px); }
    50% { transform: translateX(0px) translateY(-10px); }
    75% { transform: translateX(-10px) translateY(-5px); }
    100% { transform: translateX(0px) translateY(0px); }
}

.header h2 {
    font-size: 36px;
    font-weight: 700;
    margin: 0;
    position: relative;
    z-index: 1;
    text-shadow: 
        0 2px 4px rgba(0,0,0,0.5),
        0 0 30px rgba(255, 107, 157, 0.8);
    letter-spacing: 1px;
}

.content {
    flex: 1;
    padding: 40px 60px;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Remove the slideUp animation from all content */
.content > * {
    opacity: 1;
    transform: none;
}

/* Only apply fade-in animation to the main content box */
.tab-container, form, .result {
    animation: fadeInCenter 0.8s ease-out;
    animation-fill-mode: both;
}

@keyframes fadeInCenter {
    0% { 
        opacity: 0;
        transform: scale(0.95);
    }
    100% { 
        opacity: 1;
        transform: scale(1);
    }
}

form { 
    background: rgba(30, 20, 40, 0.8);
    backdrop-filter: blur(15px);
    padding: 40px; 
    border-radius: 20px;
    border: 1px solid rgba(255, 107, 157, 0.3);
    margin-bottom: 25px;
    box-shadow: 
        inset 0 1px 3px rgba(0,0,0,0.3),
        0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    margin: 0 auto 25px auto;
}

label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #f0f0f0;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    position: relative;
    padding-left: 8px;
}

label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: linear-gradient(45deg, #ff6b9d, #8e44ad);
    border-radius: 2px;
}

input[type='file'], input[type='password'], input[type='text'] { 
    width: 100%; 
    padding: 25px;
    border: 2px solid rgba(255, 107, 157, 0.4);
    border-radius: 15px;
    font-size: 18px;
    margin-bottom: 30px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(30, 20, 40, 0.7);
    color: #ffffff;
    position: relative;
    backdrop-filter: blur(10px);
}

input[type='file']:hover, input[type='password']:hover, input[type='text']:hover {
    border-color: rgba(255, 107, 157, 0.8);
    background: rgba(40, 25, 50, 0.8);
    box-shadow: 0 5px 20px rgba(255, 107, 157, 0.3);
}

input[type='file']:focus, input[type='password']:focus, input[type='text']:focus {
    outline: none;
    border-color: #ff6b9d;
    background: rgba(50, 30, 60, 0.8);
    box-shadow: 
        0 0 0 4px rgba(255, 107, 157, 0.3),
        0 5px 20px rgba(255, 107, 157, 0.4),
        0 0 30px rgba(255, 107, 157, 0.1);
    transform: translateY(-2px);
}

input[type='password']::placeholder, input[type='text']::placeholder {
    color: #b0b0b0;
}

/* Add a subtle pattern overlay for more depth */
.container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(255,255,255,0.04) 1px, transparent 0);
    background-size: 30px 30px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.3;
}

/* Ensure content is above the pattern */
.header, .content {
    position: relative;
    z-index: 1;
}

/* Add a nice shadow to sections */
#loginSection, #mainSection {
    position: relative;
    z-index: 1;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center center;
}

/* Smooth section transitions */
#loginSection.hidden, #mainSection.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

/* Improve button hover effects */
button { 
    width: 100%; 
    padding: 25px;
    background: linear-gradient(45deg, #ff6b9d 0%, #e91e63 25%, #c44569 50%, #8e44ad 75%, #9b59b6 100%);
    background-size: 300% 300%;
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 15px 35px rgba(255, 107, 157, 0.4);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: buttonGradient 3s ease-in-out infinite;
    transform: translateZ(0); /* Hardware acceleration */
}

@keyframes buttonGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

button::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;
}

button:hover::before {
    left: 100%;
}

button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(255, 107, 157, 0.5),
        0 10px 20px rgba(142, 68, 173, 0.3);
}

button:active {
    transform: translateY(-1px) scale(1.01);
}

.btn-secondary {
    background: linear-gradient(45deg, #ff6b9d 0%, #e91e63 50%, #c44569 100%);
    margin-top: 15px;
    font-size: 16px;
    min-width: 200px;
    box-shadow: 0 12px 30px rgba(255, 107, 157, 0.4);
}

.btn-secondary:hover {
    box-shadow: 0 18px 40px rgba(255, 107, 157, 0.6);
}

.btn-download {
    background: linear-gradient(45deg, #8e44ad 0%, #9b59b6 50%, #6a1b9a 100%) !important;
    color: white !important;
    box-shadow: 0 12px 30px rgba(142, 68, 173, 0.4) !important;
}

.btn-download:hover {
    box-shadow: 0 18px 40px rgba(142, 68, 173, 0.6) !important;
}

.btn-logout { 
    width: auto !important;
    padding: 15px 40px !important;
    background: linear-gradient(45deg, #ff3366 0%, #ff6b9d 100%) !important;
    background-size: 200% 200% !important;
    color: white;
    border: none !important;
    border-radius: 50px !important;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(255, 51, 102, 0.5);
    position: relative;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0 auto;
    display: inline-block;
    /* Remove any parent box look */
    background-clip: padding-box;
    outline: none !important;
    box-sizing: border-box;
}

.btn-logout:focus {
    outline: none !important;
    border: none !important;
    box-shadow: 0 10px 25px rgba(255, 51, 102, 0.5);
}

.btn-logout:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(255, 51, 102, 0.6);
    background-position: right center !important;
}

.message { 
    padding: 30px; 
    margin: 30px 0; 
    border-radius: 20px;
    font-weight: 600;
    text-align: center;
    border: 1px solid rgba(255, 107, 157, 0.3);
    backdrop-filter: blur(10px);
    animation: slideInFromTop 0.5s ease-out;
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success { 
    background: rgba(20, 40, 20, 0.6);
    color: #4ade80; 
    border-color: rgba(74, 222, 128, 0.4);
    box-shadow: 0 15px 35px rgba(74, 222, 128, 0.2);
}

.error { 
    background: rgba(40, 20, 30, 0.6);
    color: #ff6b9d; 
    border-color: rgba(255, 107, 157, 0.4);
    box-shadow: 0 15px 35px rgba(255, 107, 157, 0.2);
}

.result { 
    margin-top: 40px; 
    padding: 40px; 
    background: linear-gradient(135deg, rgba(30, 20, 40, 0.9) 0%, rgba(40, 25, 50, 0.9) 100%);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(74, 222, 128, 0.3);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 60px rgba(74, 222, 128, 0.1);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.result h3 {
    color: #4ade80;
    font-size: 28px;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.result p {
    margin-bottom: 25px;
    font-size: 16px;
    color: #e0e0e0;
}

.result a {
    color: #ff6b9d;
    text-decoration: none;
    font-weight: 600;
    word-break: break-all;
    transition: all 0.3s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.result a:hover {
    color: #e91e63;
    text-decoration: underline;
    text-shadow: 0 0 10px rgba(255, 107, 157, 0.8);
}

.qr-container {
    background: white;
    padding: 20px;
    border-radius: 16px;
    display: inline-block;
    margin: 20px 0;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 0 0 8px rgba(255, 107, 157, 0.1);
    transition: transform 0.3s ease;
}

.qr-container:hover {
    transform: scale(1.05);
}

.qr-container img {
    display: block;
    border-radius: 8px;
}

/* File input styling for dark theme */
input[type="file"]::-webkit-file-upload-button {
    background: linear-gradient(135deg, #ff6b9d 0%, #c44569 50%, #8e44ad 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    margin-right: 15px;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="file"]::-webkit-file-upload-button:hover {
    background: linear-gradient(135deg, #e91e63 0%, #ad2e5a 50%, #7a3a95 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 157, 0.4);
}

/* Force hide progress bar - absolute override */
#uploadProgress {
    display: none;
}

#uploadProgress.active {
    display: block !important;
}

/* Upload Progress Bar Styles */
.upload-progress-container {
    background: rgba(30, 20, 40, 0.9);
    border: 1px solid rgba(255, 107, 157, 0.3);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.upload-status {
    text-align: center;
    margin-bottom: 15px;
    font-weight: 600;
    color: #ff6b9d;
    font-size: 16px;
}

.upload-filename {
    text-align: center;
    margin-bottom: 20px;
    color: #b0b0b0;
    font-size: 14px;
    word-break: break-word;
}

.progress-bar-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    height: 8px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff6b9d, #8e44ad);
    border-radius: 20px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Enhanced input styling */
input[type='file'], input[type='password'], input[type='text'] { 
    width: 100%; 
    padding: 25px;
    border: 2px solid rgba(255, 107, 157, 0.4);
    border-radius: 15px;
    font-size: 18px;
    margin-bottom: 30px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(30, 20, 40, 0.7);
    color: #ffffff;
    position: relative;
    backdrop-filter: blur(10px);
}

/* Success and error states for better feedback */
.input-success {
    border-color: rgba(74, 222, 128, 0.6) !important;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2) !important;
}

.input-error {
    border-color: rgba(239, 68, 68, 0.6) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Enhanced header with subtle glowing effect */
.header {
    background: linear-gradient(135deg, #ff6b9d 0%, #e91e63 25%, #c44569 50%, #8e44ad 75%, #9b59b6 100%);
    background-size: 300% 300%;
    color: white;
    padding: 50px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: headerGradient 4s ease-in-out infinite;
    border-bottom: 3px solid rgba(255, 107, 157, 0.3);
    box-shadow: 
        0 8px 32px rgba(255, 107, 157, 0.3),
        0 0 60px rgba(255, 107, 157, 0.1);
}

/* Improved tab container styling */
.tab-container {
    background: rgba(30, 20, 40, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 107, 157, 0.2);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 60px rgba(255, 107, 157, 0.1);
    padding: 0;
    margin: 20px auto;
    max-width: 700px;
    overflow: hidden;
}

/* Fixed tab buttons */
.tab-buttons {
    background: rgba(20, 15, 30, 0.8);
    padding: 8px;
    border-radius: 20px 20px 0 0;
    display: flex;
    gap: 8px;
    z-index: 10; /* Ensure buttons are clickable */
    position: relative;
}

/* Rounded pill tabs */
.tab-button {
    border-radius: 20px 20px 0 0;
    margin: 0 4px;
}
.tab-button:first-child {
    margin-left: 0;
}
.tab-button:last-child {
    margin-right: 0;
}

.tab-button {
    flex: 1;
    padding: 16px 20px;
    background: #2a1e3a;
    border: none;
    border-radius: 16px;
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 15; /* Higher z-index to ensure clickability */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.tab-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, #ff6b9d, #8e44ad);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 16px;
    z-index: -1;
}

.tab-button.active::before {
    opacity: 1;
}

.tab-button span {
    position: relative;
    z-index: 2;
}

.tab-button.active {
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #ff6b9d 0%, #e91e63 100%);
    box-shadow: 0 6px 15px rgba(255, 107, 157, 0.5);
}

.tab-button:hover:not(.active) {
    background: rgba(255, 107, 157, 0.2);
    color: #ff6b9d;
    transform: translateY(-2px);
}

/* Enhanced tab content */
.tab-content {
    padding: 40px;
    position: relative;
    z-index: 5;
}

.tab-pane {
    display: none;
    animation: slideInFade 0.4s ease-out;
    position: relative;
}

.tab-pane.active {
    display: block;
}

@keyframes slideInFade {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced form styling */
form {
    background: rgba(20, 15, 30, 0.6);
    border: 1px solid rgba(255, 107, 157, 0.2);
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Enhanced button hover effects */
button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(255, 107, 157, 0.4),
        0 0 60px rgba(255, 107, 157, 0.2);
}

/* Enhanced file input styling */
input[type='file'] {
    position: relative;
    cursor: pointer;
}

input[type='file']:hover {
    transform: translateY(-1px);
}

/* Enhanced result styling */
.result {
    background: linear-gradient(135deg, rgba(30, 20, 40, 0.9) 0%, rgba(40, 25, 50, 0.9) 100%);
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 60px rgba(74, 222, 128, 0.1);
}

.result h3 {
    color: #4ade80;
    font-size: 28px;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Enhanced QR container */
.qr-container {
    background: white;
    padding: 20px;
    border-radius: 16px;
    display: inline-block;
    margin: 20px 0;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 0 0 8px rgba(255, 107, 157, 0.1);
    transition: transform 0.3s ease;
}

.qr-container:hover {
    transform: scale(1.05);
}

.qr-container img {
    display: block;
    border-radius: 8px;
}

/* Enhanced loading states */
.page-loading {
    opacity: 0;
}

.page-loaded {
    opacity: 1;
    transition: opacity 0.6s ease-out;
}

/* Improved history styling */
.history-item {
    background: rgba(30, 20, 40, 0.8);
    border: 1px solid rgba(255, 107, 157, 0.2);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 107, 157, 0.2);
    border-color: rgba(255, 107, 157, 0.4);
}

/* Enhanced upload progress */
.upload-progress-container {
    background: rgba(30, 20, 40, 0.9);
    border: 1px solid rgba(255, 107, 157, 0.3);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.progress-bar-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    height: 8px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff6b9d, #8e44ad);
    border-radius: 20px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Enhanced section transitions */
#loginSection, #mainSection {
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center center;
}

#loginSection.hidden, #mainSection.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

/* Enhanced mobile responsiveness */
@media (max-width: 768px) {
    .container {
        margin: 0;
        border-radius: 0;
    }
    
    .header {
        padding: 30px 20px;
        border-radius: 0;
    }
    
    .header h2 {
        font-size: 28px;
    }
    
    .content {
        padding: 20px;
    }
    
    .tab-container {
        margin: 10px;
        border-radius: 16px;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    form {
        padding: 25px;
    }
    
    .tab-buttons {
        flex-direction: column;
        gap: 4px;
    }
    
    .tab-button {
        width: 100%;
    }
}

/* Enhanced focus indicators for accessibility */
input[type='file']:focus,
input[type='password']:focus,
input[type='text']:focus,
button:focus,
.tab-button:focus {
    outline: 3px solid rgba(255, 107, 157, 0.5);
    outline-offset: 2px;
}

/* Subtle animation for form elements on load */
form input,
form button,
form label {
    animation: slideInFromLeft 0.6s ease-out;
    animation-fill-mode: both;
}

form input:nth-child(1) { animation-delay: 0.1s; }
form input:nth-child(2) { animation-delay: 0.2s; }
form button { animation-delay: 0.3s; }

@keyframes slideInFromLeft {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Enhanced message animations */
.message {
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(-20px);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05) translateY(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Improved error message styling */
.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(220, 38, 38, 0.9));
    border: 1px solid rgba(239, 68, 68, 0.6);
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.3);
}

.success {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.9), rgba(34, 197, 94, 0.9));
    border: 1px solid rgba(74, 222, 128, 0.6);
    box-shadow: 0 10px 30px rgba(74, 222, 128, 0.3);
}

/* Enhanced logout button styling */
.btn-logout {
    background: linear-gradient(45deg, #ff4757, #ff3742);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(255, 71, 87, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    width: auto;
    max-width: 300px;
    margin: 0 auto;
    display: block;
}

.btn-logout:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 30px rgba(255, 71, 87, 0.4);
    background: linear-gradient(45deg, #ff3742, #ff2f3a);
}

.btn-logout:active {
    transform: translateY(0) scale(1);
}

.logout-form {
    background: none !important;
    backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    max-width: none !important;
    margin: 0 auto !important;
}

/* Enhanced secondary button styling */
.btn-secondary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    margin: 5px;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    background: linear-gradient(45deg, #764ba2, #667eea);
}

.btn-download {
    background: linear-gradient(45deg, #11998e, #38ef7d) !important;
    box-shadow: 0 6px 20px rgba(17, 153, 142, 0.3) !important;
}

.btn-download:hover {
    background: linear-gradient(45deg, #38ef7d, #11998e) !important;
    box-shadow: 0 8px 25px rgba(17, 153, 142, 0.4) !important;
}

/* Enhanced file preview styling */
.file-preview {
    animation: slideInFromBottom 0.4s ease-out !important;
    border: 2px dashed rgba(74, 222, 128, 0.6) !important;
    background: rgba(74, 222, 128, 0.1) !important;
    backdrop-filter: blur(10px);
}

@keyframes slideInFromBottom {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced help text styling */
.help-text {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-top: 20px;
    text-align: center;
}

.help-text small {
    color: #93c5fd;
    line-height: 1.5;
}

/* Enhanced container and overall layout */
.container {
    animation: containerFadeIn 1s ease-out;
}

@keyframes containerFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.98);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Smooth scrolling for the page */
html {
    scroll-behavior: smooth;
}

/* Enhanced shadow effects for depth */
.tab-container,
form,
.result,
.message {
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.25),
        0 0 60px rgba(255, 107, 157, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Subtle pulse animation for important elements */
.btn-secondary.btn-download {
    animation: subtlePulse 3s ease-in-out infinite;
}

@keyframes subtlePulse {
    0%, 100% {
        box-shadow: 0 6px 20px rgba(17, 153, 142, 0.3);
    }
    50% {
        box-shadow: 0 8px 30px rgba(17, 153, 142, 0.5);
    }
}

/* Ensure emojis display in their native color */
.emoji, [role="img"] {
    color: initial !important;
}

/* Initial page loading state */
body {
    opacity: 0;
    transition: opacity 0.8s ease-out;
}

body.loaded {
    opacity: 1;
}

/* Static header - no animation */
.header {
    transform: none !important;
    animation: none !important;
}

/* History List Styling - Enhanced for server-side history */
.history-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(30,20,40,0.4);
    border-radius: 15px;
    border: 1px solid rgba(255,107,157,0.2);
}

.history-header h3 {
    font-size: 24px;
    color: #ffffff;
    margin-bottom: 8px;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.history-header p {
    color: #cccccc;
    font-size: 14px;
}

.history-loading, .history-error, .history-empty {
    text-align: center;
    padding: 40px 20px;
    background: rgba(30,20,40,0.4);
    border-radius: 15px;
    border: 1px solid rgba(255,107,157,0.2);
    color: #cccccc;
}

.history-error {
    border-color: rgba(255,68,68,0.3);
}

.retry-btn {
    background: linear-gradient(45deg, #ff6b9d, #e91e63);
    color: #ffffff;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.retry-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255,107,157,0.4);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.history-item {
    background: rgba(30,20,40,0.6);
    border: 1px solid rgba(255,107,157,0.3);
    border-radius: 15px;
    padding: 25px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.history-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff6b9d, #c44569, #8e44ad);
    border-radius: 15px 15px 0 0;
}

.history-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(255,107,157,0.3);
    border-color: rgba(255,107,157,0.5);
}

.history-item-header {
    margin-bottom: 20px;
}

.history-item-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item-title {
    font-weight: 700;
    color: #ffffff;
    font-size: 18px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.history-item-meta {
    font-size: 13px;
    color: #aaaaaa;
    display: flex;
    gap: 10px;
    align-items: center;
}

.history-item-content {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 25px;
    align-items: start;
}

.history-qr-container {
    text-align: center;
    padding: 15px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    border: 1px solid rgba(255,107,157,0.2);
}

.history-qr {
    max-width: 150px;
    max-height: 150px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    background: white;
    padding: 5px;
    margin-bottom: 10px;
}

.qr-label {
    font-size: 12px;
    color: #cccccc;
    margin: 0;
}

.history-item-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-link {
    color: #ffffff;
    background: rgba(142,68,173,0.3);
    padding: 12px 18px;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 600;
    text-align: center;
    border: 1px solid rgba(142,68,173,0.4);
    display: block;
}

.history-link.primary {
    background: linear-gradient(45deg, #ff6b9d, #c44569);
    border-color: rgba(255,107,157,0.5);
}

.history-link:hover {
    background: rgba(142,68,173,0.6);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(142,68,173,0.4);
}

.history-link.primary:hover {
    background: linear-gradient(45deg, #e91e63, #c44569);
    box-shadow: 0 8px 20px rgba(255,107,157,0.4);
}

.copy-btn {
    background: rgba(76,175,80,0.3) !important;
    border-color: rgba(76,175,80,0.4) !important;
}

.copy-btn:hover {
    background: rgba(76,175,80,0.6) !important;
    box-shadow: 0 8px 20px rgba(76,175,80,0.4) !important;
}

.history-footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    background: rgba(30,20,40,0.3);
    border-radius: 12px;
    border: 1px solid rgba(255,107,157,0.15);
}

.history-footer p {
    color: #aaaaaa;
    margin: 0;
}

/* Toast message for copy feedback */
.toast-message {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Responsive design for history */
@media (max-width: 768px) {
    .history-item-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .history-qr-container {
        justify-self: center;
        max-width: 200px;
    }
    
    .history-item-links {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .history-item {
        padding: 20px 15px;
    }
    
    .history-item-title {
        font-size: 16px;
    }
    
    .history-link {
        padding: 10px 15px;
        font-size: 14px;
    }
}
