/* ==========================================
   QR Employee Card System - Main Styles
   ========================================== */

/* CSS Variables */
:root {
    /* Colors - Turquoise/Teal Theme matching Hadiyah */
    --primary-color: #008B8B;
    --primary-dark: #006666;
    --primary-light: #20B2AA;
    --secondary-color: #00CED1;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;

    /* Gradients - Turquoise Theme */
    --gradient-primary: linear-gradient(135deg, #008B8B 0%, #20B2AA 100%);
    --gradient-secondary: linear-gradient(135deg, #00CED1 0%, #40E0D0 100%);
    --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-dark: linear-gradient(135deg, #006666 0%, #008B8B 100%);

    /* Neutral Colors */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gradient-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(99, 102, 241, 0.2) 0%, transparent 50%);
    animation: backgroundMove 20s ease-in-out infinite;
    z-index: -1;
}

@keyframes backgroundMove {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    50% {
        transform: translate(5%, 5%) rotate(5deg);
    }
}

/* Container */
.container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

/* Card Wrapper */
.card-wrapper {
    perspective: 1000px;
}

/* Loading State */
.loading {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    box-shadow: var(--shadow-xl);
    animation: fadeIn 0.3s ease-in-out;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto var(--spacing-md);
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
}

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

/* Error Message */
.error-message {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    box-shadow: var(--shadow-xl);
    animation: fadeIn 0.3s ease-in-out;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
}

.error-message h2 {
    color: var(--danger-color);
    margin-bottom: var(--spacing-sm);
}

/* Card Container */
.employee-card-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--bg-primary);
}

/* Employee Card - Mobile Optimized */
.employee-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    padding: 1rem;
    box-shadow:
        0 20px 60px rgba(0, 139, 139, 0.15),
        0 0 0 1px rgba(0, 139, 139, 0.1);
    animation: cardSlideIn 0.5s ease-out;
    position: relative;
    overflow: visible;
    border: 2px solid #008B8B;
    max-width: 380px;
    width: 100%;
}

.employee-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 139, 139, 0.03) 0%, transparent 70%);
    animation: cardGlow 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Card Header */
.card-header {
    text-align: center;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
}

.company-logo {
    width: 180px;
    height: auto;
    margin: 0 auto 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.company-logo img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Employee Photo */
.employee-photo-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 0.75rem;
}

.photo-ring {
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #008B8B 0%, #20B2AA 100%);
    animation: ringPulse 2s ease-in-out infinite;
    z-index: 0;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.employee-photo {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 6px 16px rgba(0, 139, 139, 0.2);
    z-index: 1;
}

/* Employee Info */
.employee-info {
    text-align: center;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
}

.employee-name {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.employee-position {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Contact Details */
.contact-details {
    margin: 0.75rem 0;
    position: relative;
    z-index: 1;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem;
    background: linear-gradient(135deg, rgba(0, 139, 139, 0.05) 0%, rgba(32, 178, 170, 0.05) 100%);
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
    transition: all var(--transition-normal);
    border: 1px solid rgba(0, 139, 139, 0.1);
}

.contact-item:hover {
    transform: translateX(-4px);
    box-shadow: 0 4px 12px rgba(0, 139, 139, 0.1);
    background: linear-gradient(135deg, rgba(0, 139, 139, 0.08) 0%, rgba(32, 178, 170, 0.08) 100%);
}

.contact-icon {
    font-size: 1.25rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 0.6rem;
    box-shadow: var(--shadow-sm);
}

.contact-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.contact-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.contact-value {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.contact-value:hover {
    color: var(--primary-color);
}

/* Save Contact Button */
.save-contact-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.save-contact-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.save-contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.save-contact-btn:hover::before {
    opacity: 1;
}

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

.btn-icon,
.btn-text {
    position: relative;
    z-index: 1;
}

.btn-icon {
    font-size: 1.2rem;
}

/* Card Footer */
.card-footer {
    text-align: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
}

.card-footer p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 640px) {
    body {
        padding: 0.5rem;
    }

    .employee-card {
        padding: 0.85rem;
    }

    .employee-name {
        font-size: 1.25rem;
    }

    .employee-position {
        font-size: 0.9rem;
    }

    .contact-item {
        padding: 0.6rem;
        gap: 0.6rem;
    }

    .contact-icon {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    body::before {
        display: none;
    }

    .save-contact-btn {
        display: none;
    }
}