/* ==========================================
   QRing - Professional UI Stylesheet
   ========================================== */

/* Root Variables */
:root {
    --primary-color: #667eea;
    --primary-dark: #764ba2;
    --secondary-color: #f093fb;
    --accent-color: #4facfe;
    --danger-color: #f5576c;
    --success-color: #34c759;
    --warning-color: #ff9500;
    --info-color: #00f2fe;
    
    --text-dark: #1a202c;
    --text-light: #718096;
    --bg-light: #f7fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --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);
}

/* ==========================================
   Base Styles
   ========================================== */

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    transition: var(--transition);
}

/* ==========================================
   Typography
   ========================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
    line-height: 1.6;
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ==========================================
   Navigation
   ========================================== */

nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

nav a {
    position: relative;
    font-weight: 500;
    color: var(--text-light);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

nav a.active {
    color: var(--primary-color);
    font-weight: 600;
}

nav a.active::after {
    width: 100%;
}

/* ==========================================
   Buttons
   ========================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.625rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    font-size: 1rem;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

/* Button base styles */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Primary Button - Main call-to-action */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    font-weight: 700;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, #5568d3 0%, #6b3a8f 100%);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4);
}

.btn-primary::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.5s;
}

.btn-primary:hover::before:not(:disabled) {
    left: 100%;
}

/* Secondary Button - Alternative action */
.btn-secondary {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: 700;
}

.btn-secondary:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

/* Danger Button - Delete/Risk actions */
.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #e83e8c 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
    font-weight: 700;
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(245, 87, 108, 0.6);
    background: linear-gradient(135deg, #e84554 0%, #d62f7a 100%);
}

.btn-danger:active:not(:disabled) {
    transform: translateY(-1px);
}

/* Success Button - Positive actions */
.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #30b040 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 199, 89, 0.4);
    font-weight: 700;
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(52, 199, 89, 0.6);
    background: linear-gradient(135deg, #2ba84a 0%, #279c38 100%);
}

.btn-success:active:not(:disabled) {
    transform: translateY(-1px);
}

/* Warning Button */
.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #ff8a00 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 149, 0, 0.4);
    font-weight: 700;
}

.btn-warning:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 149, 0, 0.6);
}

/* Info Button */
.btn-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #00d4ff 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.4);
    font-weight: 700;
}

.btn-info:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 242, 254, 0.6);
}

/* Outline Button - Subtle action */
.btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-dark);
    font-weight: 700;
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-outline:active:not(:disabled) {
    transform: translateY(0);
}

/* Ghost Button - Minimal style */
.btn-ghost {
    background: transparent;
    color: var(--primary-color);
    border: none;
    font-weight: 700;
}

.btn-ghost:hover:not(:disabled) {
    color: var(--primary-dark);
    background: rgba(102, 126, 234, 0.08);
}

/* Link Button - Text style */
.btn-link {
    background: transparent;
    color: var(--primary-color);
    border: none;
    padding: 0.5rem 0;
    text-decoration: underline;
    font-weight: 600;
}

.btn-link:hover:not(:disabled) {
    color: var(--primary-dark);
}

/* Button Sizes */
.btn-xs {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 0.375rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 0.5rem;
}

.btn-md {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 0.625rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    border-radius: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.btn-xl {
    padding: 1.25rem 2.5rem;
    font-size: 1.25rem;
    border-radius: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Full Width Button */
.btn-block {
    width: 100%;
    display: flex;
}

/* Button with Icon */
.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon-left {
    flex-direction: row;
}

.btn-icon-right {
    flex-direction: row-reverse;
}

/* Icon-only Button */
.btn-icon-only {
    padding: 0.75rem;
    border-radius: 0.5rem;
    width: auto;
    min-width: 44px;
    min-height: 44px;
}

/* Loading State */
.btn-loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    display: inline-block;
    margin-left: 0.5rem;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Button Group */
.btn-group {
    display: inline-flex;
    border-radius: 0.625rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.btn-group .btn {
    border-radius: 0;
    border: none;
    margin: 0;
    flex: 1;
}

.btn-group .btn:not(:last-child) {
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

/* ==========================================
   Cards & Containers
   ========================================== */

.card {
    background: var(--bg-white);
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

.card-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.card-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* ==========================================
   Forms & Inputs
   ========================================== */

input,
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    background-color: var(--bg-white);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group {
    margin-bottom: 1.5rem;
}

/* ==========================================
   Gradients
   ========================================== */

.gradient-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.gradient-secondary {
    background: linear-gradient(135deg, var(--secondary-color), var(--danger-color));
}

.gradient-accent {
    background: linear-gradient(135deg, var(--accent-color), var(--info-color));
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================
   Hero Sections
   ========================================== */

.hero {
    padding: 4rem 0;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    filter: blur(40px);
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    filter: blur(40px);
}

.hero-content {
    position: relative;
    z-index: 1;
}

/* ==========================================
   Feature Grid
   ========================================== */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.feature-card {
    padding: 2rem;
    background: var(--bg-white);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
    border-radius: 0.5rem;
    color: white;
}

/* ==========================================
   Badges & Tags
   ========================================== */

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: var(--transition);
}

.badge-primary {
    background: rgba(102, 126, 234, 0.2);
    color: var(--primary-color);
}

.badge-success {
    background: rgba(52, 199, 89, 0.2);
    color: var(--success-color);
}

.badge-danger {
    background: rgba(245, 87, 108, 0.2);
    color: var(--danger-color);
}

/* ==========================================
   Animations
   ========================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease-out;
}

.animate-slideUp {
    animation: slideUp 0.5s ease-out;
}

.animate-slideDown {
    animation: slideDown 0.3s ease-out;
}

.animate-slideIn {
    animation: slideIn 0.3s ease-out;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ==========================================
   Footer
   ========================================== */

footer {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    color: #cbd5e0;
    padding: 3rem 0 1rem;
}

footer h4 {
    color: white;
    margin-bottom: 1rem;
}

footer a {
    color: #cbd5e0;
    transition: var(--transition);
}

footer a:hover {
    color: white;
}

footer .social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    margin-right: 0.5rem;
    transition: var(--transition);
}

footer .social-links a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* ==========================================
   Responsive Design
   ========================================== */

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .hero {
        padding: 3rem 1rem;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .btn {
        width: 100%;
    }
}

/* ==========================================
   Utility Classes
   ========================================== */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.rounded-full {
    border-radius: 9999px;
}

.rounded-lg {
    border-radius: 0.5rem;
}

.rounded-xl {
    border-radius: 0.75rem;
}

.shadow-soft {
    box-shadow: var(--shadow-sm);
}

.shadow-medium {
    box-shadow: var(--shadow-md);
}

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

.shadow-xl {
    box-shadow: var(--shadow-xl);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ==========================================
   Accessibility
   ========================================== */

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Focus styles */
button:focus,
a:focus,
input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: more) {
    body {
        font-weight: 500;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
