/**
 * VoteSecure Common Styles
 * Shared across all pages
 */

/* ============================================================================
   VARIABLES & RESET
   ============================================================================ */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --dark: #1e293b;
    --gray: #64748b;
    --light-gray: #cbd5e1;
    --bg: #f8fafc;
    --white: #ffffff;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: var(--bg);
    overflow-x: hidden;
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.25rem; }

p { margin-bottom: 1rem; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ============================================================================
   CONTAINER & LAYOUT
   ============================================================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.main-content {
    min-height: calc(100vh - 200px);
    padding: 4rem 0;
}

/* ============================================================================
   NAVIGATION
   ============================================================================ */

.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
}

.nav-brand a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: inherit;
}

.logo-icon {
    width: 32px;
    height: 32px;
    stroke-width: 2.5;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--gray);
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-secondary:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.btn-outline:hover {
    background: var(--white);
    color: var(--primary);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-copy {
    background: var(--light-gray);
    color: var(--dark);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-copy:hover {
    background: var(--primary);
    color: var(--white);
}

/* ============================================================================
   FOOTER
   ============================================================================ */

.footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    text-align: center;
    color: var(--gray);
}

.footer a {
    color: var(--primary);
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background: #d1fae5;
    color: #065f46;
}

.status-ended {
    background: #fee2e2;
    color: #991b1b;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

/* Service status indicator */
.service-status {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}

.service-status.loading {
    background: #f59e0b;
    animation: pulse 1.5s ease-in-out infinite;
}

.service-status.ready {
    background: #10b981;
}

.service-status.error {
    background: #ef4444;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================================================
   LOADING & ERROR STATES
   ============================================================================ */

.spinner {
    border: 4px solid var(--light-gray);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-state {
    text-align: center;
    padding: 3rem 0;
}

.error-state {
    text-align: center;
    padding: 3rem 2rem;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }

    .container {
        padding: 0 1rem;
    }

    .main-content {
        padding: 2rem 0;
    }

    .navbar .container {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .nav-brand {
        font-size: 1.25rem;
    }

    .logo-icon {
        width: 28px;
        height: 28px;
    }

    .nav-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .btn {
        font-size: 0.9rem;
        padding: 0.65rem 1.25rem;
    }

    .btn-sm {
        padding: 0.5rem 0.875rem;
        font-size: 0.8rem;
    }

    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}

/* Mobile phones (narrow screens) */
@media (max-width: 480px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.125rem; }

    .container {
        padding: 0 0.75rem;
    }

    .main-content {
        padding: 1.5rem 0;
    }

    .navbar {
        padding: 0.75rem 0;
    }

    .navbar .container {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-brand {
        justify-content: center;
        font-size: 1.125rem;
    }

    .logo-icon {
        width: 24px;
        height: 24px;
    }

    .nav-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }

    .nav-actions button,
    .nav-actions a {
        width: 100%;
        justify-content: center;
    }

    .btn {
        width: 100%;
        justify-content: center;
        font-size: 0.875rem;
        padding: 0.75rem 1rem;
    }

    .btn svg {
        width: 18px;
        height: 18px;
    }

    .btn-sm {
        padding: 0.625rem 0.875rem;
        font-size: 0.8125rem;
    }

    .btn-lg {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }

    .footer {
        padding: 1.5rem 0;
        font-size: 0.875rem;
    }

    .notification {
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
    }
}

/* Notifications */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  background: white;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  z-index: 10000;
  transform: translateX(400px);
  transition: transform 0.3s ease;
  max-width: 400px;
}
.notification.show { transform: translateX(0); }
.notification-success { border-left: 4px solid #10b981; }
.notification-error   { border-left: 4px solid #ef4444; }
.notification-info    { border-left: 4px solid #3b82f6; }
.notification-warning { border-left: 4px solid #f59e0b; }