/* ==========================================
   GUARD KEY - MODERN PREMIUM UI/UX DESIGN
   Kullanıcı Tarafı Stilleri
   ========================================== */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@400;500;600;700;800&display=swap');

/* CSS Variables - Design System */
:root {
    /* Colors - Light Theme */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.1);
    --text-primary: #1a1a2e;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --border-glass: rgba(255, 255, 255, 0.18);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 8px 32px rgba(102, 126, 234, 0.3);
    --blur-glass: blur(10px);
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --bg-primary: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    --bg-secondary: rgba(22, 33, 62, 0.95);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --text-primary: #ffffff;
    --text-secondary: #cbd5e0;
    --text-muted: #a0aec0;
    --border-color: rgba(255, 255, 255, 0.1);
    --border-glass: rgba(255, 255, 255, 0.15);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 8px 32px rgba(102, 126, 234, 0.5);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
    transition: background 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animated Background Particles */
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.6;
}

/* Animated Gradient Background (fallback) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    z-index: -2;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { 
        background-position: 0% 50%; 
    }
    50% { 
        background-position: 100% 50%; 
    }
}

/* Container */
.container {
    width: 100%;
    max-width: 650px;
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Glassmorphism Card */
.purchase-card {
    background: var(--bg-glass);
    backdrop-filter: var(--blur-glass);
    -webkit-backdrop-filter: var(--blur-glass);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-glass);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.purchase-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
}

/* Card Header - Gradient */
.card-header {
    background: var(--primary-gradient);
    background-size: 200% 200%;
    color: white;
    padding: 50px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: gradientMove 8s ease infinite;
}

@keyframes gradientMove {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Floating Particles in Header */
.card-header::before,
.card-header::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 6s ease-in-out infinite;
}

.card-header::before {
    width: 100px;
    height: 100px;
    top: -50px;
    left: -50px;
}

.card-header::after {
    width: 150px;
    height: 150px;
    bottom: -75px;
    right: -75px;
    animation-delay: 3s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* Theme Toggle Button */
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.2);
}

/* Header Icon */
.header-icon {
    font-size: 64px;
    margin-bottom: 15px;
    animation: bounceIn 1s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: inline-block;
}

@keyframes bounceIn {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.2) rotate(20deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.card-header h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.card-header p {
    font-size: 16px;
    opacity: 0.95;
    font-weight: 400;
}

/* Card Body - Glass Effect */
.card-body {
    padding: 40px;
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
}

/* Form Groups */
.form-group {
    margin-bottom: 24px;
    animation: fadeIn 0.6s ease-in-out backwards;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Form Controls - Modern Style */
.form-control {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.form-control:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

/* Select Dropdown Custom Style */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23667eea' d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 45px;
    cursor: pointer;
}

/* Selected Product Info - Cyber Card Style */
#selectedProductInfo {
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 500px;
    }
}

.selected-product {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 24px;
    border: 2px solid transparent;
    border-image: linear-gradient(135deg, #667eea, #764ba2) 1;
    position: relative;
    overflow: hidden;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.8;
}

.selected-product::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;
}

.selected-product:hover::before {
    left: 100%;
}

/* Payment Button - Gradient with Glow */
.btn-payment {
    width: 100%;
    padding: 18px 32px;
    background: var(--primary-gradient);
    background-size: 200% 200%;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-payment::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-payment:hover:not(:disabled)::before {
    width: 300px;
    height: 300px;
}

.btn-payment:hover:not(:disabled) {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
    animation: gradientMove 2s ease infinite;
}

.btn-payment:active:not(:disabled) {
    transform: translateY(-2px) scale(0.98);
}

.btn-payment:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Info Box */
.info-box {
    background: rgba(102, 126, 234, 0.05);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.info-box ul {
    list-style: none;
    padding: 0;
}

.info-box li {
    padding: 8px 0;
    color: var(--text-secondary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-box li::before {
    content: "✓";
    color: #667eea;
    font-weight: bold;
    font-size: 18px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 50%;
}

/* Security Info */
.security-info {
    text-align: center;
    color: #4caf50;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
}

.security-info span {
    font-size: 16px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Result Cards (Success/Error) */
.result-card {
    background: var(--bg-secondary);
    border-radius: 24px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    animation: zoomIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.result-card.success {
    border-top: 6px solid #4caf50;
}

.result-card.error {
    border-top: 6px solid #f44336;
}

.result-icon {
    font-size: 80px;
    margin-bottom: 24px;
    animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.result-card h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.result-card p {
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-size: 16px;
    line-height: 1.6;
}

.info-text {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 24px;
}

/* Primary Button */
.btn-primary {
    display: inline-block;
    padding: 14px 36px;
    background: var(--primary-gradient);
    background-size: 200% 200%;
    color: white;
    text-decoration: none;
    border-radius: 12px;
    margin-top: 24px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
    animation: gradientMove 2s ease infinite;
}

/* Alerts */
.alert {
    padding: 18px 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.4s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-error {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
    border-color: #f44336;
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
    border-color: #4caf50;
}

.alert::before {
    content: '⚠';
    font-size: 24px;
}

.alert-success::before {
    content: '✓';
}

/* Responsive Design - Mobile First */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .container {
        max-width: 100%;
    }
    
    .purchase-card {
        border-radius: 20px;
    }
    
    .card-header {
        padding: 40px 24px;
    }
    
    .card-header h1 {
        font-size: 28px;
    }
    
    .header-icon {
        font-size: 48px;
    }
    
    .card-body {
        padding: 24px;
    }
    
    .theme-toggle {
        width: 45px;
        height: 45px;
        font-size: 20px;
        top: 15px;
        right: 15px;
    }
    
    .btn-payment {
        padding: 16px 24px;
        font-size: 16px;
    }
    
    .result-card {
        padding: 40px 24px;
    }
    
    .result-card h1 {
        font-size: 28px;
    }
    
    .result-icon {
        font-size: 64px;
    }
}

@media (max-width: 480px) {
    .card-header h1 {
        font-size: 24px;
    }
    
    .card-header p {
        font-size: 14px;
    }
    
    .form-control {
        padding: 14px 16px;
        font-size: 15px;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Smooth Transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Focus Visible - Accessibility */
*:focus-visible {
    outline: 3px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .theme-toggle,
    #particles-js {
        display: none;
    }
}
