/* ========================================
   CSS Variables - Color Theme & Settings
   ======================================== */
:root {
    --bg-primary: #0a0e27;
    --bg-secondary: #1a1f3a;
    --bg-card: #151932;
    --primary-color: #6366f1;
    --primary-hover: #7c3aed;
    --secondary-color: #a855f7;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #2d3354;
    --success-color: #10b981;
    --shadow-sm: 0 2px 8px rgba(99, 102, 241, 0.1);
    --shadow-md: 0 4px 16px rgba(99, 102, 241, 0.15);
    --shadow-lg: 0 8px 32px rgba(99, 102, 241, 0.2);
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   Global Reset & Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-primary);
    position: relative;
    overflow-x: hidden;
    padding: 20px;
}

/* ========================================
   Background Animation
   ======================================== */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    opacity: 0.1;
    filter: blur(60px);
    animation: float 20s infinite ease-in-out;
}

.circle-1 {
    width: 400px;
    height: 400px;
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.circle-2 {
    width: 300px;
    height: 300px;
    top: 50%;
    right: -150px;
    animation-delay: 3s;
}

.circle-3 {
    width: 500px;
    height: 500px;
    bottom: -250px;
    left: 50%;
    animation-delay: 6s;
}

.circle-4 {
    width: 350px;
    height: 350px;
    top: 20%;
    right: 10%;
    animation-delay: 9s;
}

.circle-5 {
    width: 250px;
    height: 250px;
    bottom: 20%;
    left: 20%;
    animation-delay: 12s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

/* ========================================
   Main Container
   ======================================== */
.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1100px;
    animation: fadeIn 0.6s ease-out;
}

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

/* ========================================
   Card Box - Horizontal Layout
   ======================================== */
.box {
    background: var(--bg-card);
    padding: 35px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    transition: var(--transition);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 35px;
    align-items: center;
}

.box:hover {
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.25);
}

/* ========================================
   Left Section - Controls
   ======================================== */
.left-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ========================================
   Right Section - QR Display
   ======================================== */
.right-section {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   Header Section
   ======================================== */
.qr-header {
    text-align: center;
}

.icon-wrapper {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-md);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 24px rgba(99, 102, 241, 0.3);
    }
}

.icon-wrapper i {
    font-size: 30px;
    color: var(--text-primary);
}

.qr-header h1 {
    font-size: 28px;
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 0;
}

/* ========================================
   Controls Section
   ======================================== */
.controls {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ========================================
   Input Group
   ======================================== */
.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 16px;
    z-index: 1;
    transition: var(--transition);
}

.input-group input {
    width: 100%;
    padding: 14px 14px 14px 45px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
}

.input-group input:focus {
    border-color: var(--primary-color);
    background: var(--bg-card);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.input-group input:focus + .input-border {
    opacity: 1;
}

.input-group input:focus ~ .input-icon {
    color: var(--primary-color);
}

.input-group input::placeholder {
    color: var(--text-secondary);
}

.input-border {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: var(--transition);
    border-radius: 2px;
}

/* ========================================
   Size Selector
   ======================================== */
.size-selector {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.size-selector label {
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.size-selector label i {
    color: var(--primary-color);
}

.size-selector select {
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
    transition: var(--transition);
    min-width: 130px;
}

.size-selector select:hover {
    border-color: var(--primary-color);
}

.size-selector select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* ========================================
   QR Body - Display Area
   ======================================== */
.qr-body {
    width: 100%;
    height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 25px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 2px dashed var(--border-color);
    transition: var(--transition);
}

.qr-body:has(img), .qr-body:has(canvas) {
    border-style: solid;
    border-color: var(--primary-color);
    background: var(--bg-card);
}

.qr-placeholder {
    text-align: center;
    color: var(--text-secondary);
}

.placeholder-icon {
    font-size: 70px;
    margin-bottom: 12px;
    opacity: 0.3;
    animation: fadeInOut 2s infinite;
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.6;
    }
}

.qr-placeholder p {
    font-size: 15px;
}

.qr-body img, .qr-body canvas {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    padding: 15px;
    background: white;
    box-shadow: var(--shadow-md);
    animation: scaleIn 0.4s ease-out;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========================================
   Footer Buttons
   ======================================== */
.qr-footer {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn {
    position: relative;
    padding: 13px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    overflow: hidden;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
}

.btn-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-shimmer {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: translateX(-100%);
}

.btn:hover .btn-shimmer {
    animation: shimmer 0.6s;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

.btn-generate {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-primary);
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.btn-generate:active {
    transform: translateY(0);
}

.btn-download {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-download:hover {
    border-color: var(--success-color);
    background: var(--success-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

.btn-download:active {
    transform: translateY(0);
}

/* ========================================
   App Footer
   ======================================== */
.app-footer {
    text-align: center;
    margin-top: 25px;
    color: var(--text-secondary);
    font-size: 13px;
}

.app-footer p {
    margin-bottom: 10px;
}

.app-footer i.fa-heart {
    color: #ef4444;
    animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    10%, 30% {
        transform: scale(1.1);
    }
    20%, 40% {
        transform: scale(1);
    }
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
}

.footer-links a {
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    background: var(--primary-color);
    color: var(--text-primary);
    border-color: var(--primary-color);
    transform: translateY(-3px);
}

/* ========================================
   Responsive Design - Tablet
   ======================================== */
@media screen and (max-width: 968px) {
    .box {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 30px;
    }

    .qr-body {
        height: 350px;
    }
}

/* ========================================
   Responsive Design - Mobile Large
   ======================================== */
@media screen and (max-width: 520px) {
    .box {
        padding: 25px 20px;
    }

    .qr-header h1 {
        font-size: 24px;
    }

    .icon-wrapper {
        width: 55px;
        height: 55px;
    }

    .icon-wrapper i {
        font-size: 26px;
    }

    .subtitle {
        font-size: 13px;
    }

    .qr-footer {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        padding: 13px 20px;
        font-size: 14px;
    }

    .size-selector {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .size-selector select {
        width: 100%;
    }

    .qr-body {
        height: 300px;
        padding: 20px;
    }
}

/* ========================================
   Responsive Design - Mobile Small
   ======================================== */
@media screen and (max-width: 380px) {
    .container {
        padding: 15px 10px;
    }

    .box {
        padding: 20px 15px;
    }

    .qr-header h1 {
        font-size: 22px;
    }

    .input-group input {
        font-size: 14px;
        padding: 12px 12px 12px 42px;
    }

    .input-icon {
        font-size: 15px;
        left: 12px;
    }

    .qr-body {
        height: 280px;
    }
}