/* Global Styles - shadcn/ui inspired */
:root {
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;
    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 222.2 84% 4.9%;
    --primary: 20 100% 60%;
    --primary-foreground: 0 0% 100%;
    --secondary: 210 40% 96.1%;
    --secondary-foreground: 222.2 47.4% 11.2%;
    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;
    --accent: 210 40% 96.1%;
    --accent-foreground: 222.2 47.4% 11.2%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 0 0% 98%;
    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 20 100% 60%;
    --radius: 0.5rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border-color: hsl(var(--border));
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 
                 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Header */
header {
    background: white;
    border-bottom: 1px solid hsl(var(--border));
    padding: 1.5rem 2rem;
    margin-bottom: 0;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

header .header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

header .header-logo {
    height: 48px;
    width: auto;
}

header .header-text h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin-bottom: 0.25rem;
    letter-spacing: -0.025em;
}

header .header-text p {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    font-weight: 400;
}

header .header-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

header .user-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: hsl(var(--muted));
    border-radius: var(--radius);
}

header .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

header .user-name {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Sections */
.section {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: hsl(var(--foreground));
    letter-spacing: -0.025em;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: hsl(var(--foreground));
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid hsl(var(--input));
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

.form-group input:disabled,
.form-group select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid transparent;
    padding: 0.5rem 1rem;
    height: 2.5rem;
}

.btn:disabled {
    opacity: 0.5;
    pointer-events: none;
}

.btn-primary {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.btn-primary:hover {
    background: hsl(var(--primary) / 0.9);
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.btn-secondary {
    background: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    border: 1px solid hsl(var(--border));
}

.btn-secondary:hover {
    background: hsl(var(--secondary) / 0.8);
}

.btn-warning {
    background: hsl(48 96% 53%);
    color: hsl(26 83% 14%);
}

.btn-warning:hover {
    background: hsl(48 96% 53% / 0.9);
}

.btn-danger {
    background: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
}

.btn-danger:hover {
    background: hsl(var(--destructive) / 0.9);
}

/* Campaign Info */
.campaign-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: hsl(var(--muted) / 0.5);
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid hsl(var(--border));
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-item .label {
    font-weight: 500;
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    border-radius: calc(var(--radius) - 2px);
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    border: 1px solid transparent;
}

.badge.CREATED { 
    background: hsl(214 95% 93%);
    color: hsl(214 84% 45%);
    border-color: hsl(214 95% 85%);
}
.badge.RUNNING { 
    background: hsl(48 96% 89%);
    color: hsl(25 95% 45%);
    border-color: hsl(48 96% 80%);
}
.badge.COMPLETED { 
    background: hsl(143 85% 96%);
    color: hsl(140 100% 27%);
    border-color: hsl(143 85% 88%);
}
.badge.FAILED { 
    background: hsl(0 93% 94%);
    color: hsl(0 84% 60%);
    border-color: hsl(0 93% 88%);
}
.badge.TEST { 
    background: hsl(326 78% 95%);
    color: hsl(326 78% 35%);
    border-color: hsl(326 78% 88%);
}
.badge.REAL { 
    background: hsl(20 100% 95%);
    color: hsl(20 100% 40%);
    border-color: hsl(20 100% 88%);
}

/* Progress Bar */
.progress-container {
    margin: 1.5rem 0;
}

.progress-bar {
    width: 100%;
    height: 0.75rem;
    background: hsl(var(--secondary));
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    border: 1px solid hsl(var(--border));
}

.progress-fill {
    height: 100%;
    background: hsl(var(--primary));
    transition: width 0.5s ease;
    width: 0%;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: shimmer 2s infinite;
}

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

.progress-text {
    text-align: center;
    margin-top: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-card {
    background: hsl(var(--card));
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid hsl(var(--border));
    transition: all 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.stat-card.success {
    border-left: 3px solid hsl(143 85% 96%);
    border-left-color: hsl(140 100% 27%);
}
.stat-card.error {
    border-left: 3px solid hsl(0 93% 94%);
    border-left-color: hsl(0 84% 60%);
}
.stat-card.pending {
    border-left: 3px solid hsl(48 96% 89%);
    border-left-color: hsl(25 95% 45%);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: hsl(var(--foreground));
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

/* Campaigns List */
.campaign-card {
    background: hsl(var(--card));
    padding: 1.25rem;
    margin-bottom: 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid hsl(var(--border));
}

.campaign-card:hover {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    border-color: hsl(var(--ring));
}

.campaign-card h3 {
    margin-bottom: 0.75rem;
    color: hsl(var(--foreground));
    font-size: 1rem;
    font-weight: 600;
}

.campaign-card-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    align-items: center;
}

/* Records List */
.records-list {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
}

.record-item {
    background: hsl(var(--card));
    padding: 1rem;
    border-bottom: 1px solid hsl(var(--border));
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.record-item:last-child {
    border-bottom: none;
}

.record-item:hover {
    background: hsl(var(--muted) / 0.5);
}

.record-email {
    font-weight: 500;
    color: hsl(var(--foreground));
    font-size: 0.875rem;
}

.record-status {
    padding: 0.25rem 0.625rem;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.record-status.ok {
    background: hsl(143 85% 96%);
    color: hsl(140 100% 27%);
    border-color: hsl(143 85% 88%);
}
.record-status.error {
    background: hsl(0 93% 94%);
    color: hsl(0 84% 60%);
    border-color: hsl(0 93% 88%);
}
.record-status.PENDING {
    background: hsl(48 96% 89%);
    color: hsl(25 95% 45%);
    border-color: hsl(48 96% 80%);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid hsl(var(--muted));
    border-top: 3px solid hsl(var(--primary));
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay p {
    color: white;
    margin-top: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 1rem 1.5rem;
    background: hsl(var(--card));
    color: hsl(var(--foreground));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    display: none;
    z-index: 2000;
    animation: slideIn 0.3s ease;
    max-width: 420px;
}

.toast.show {
    display: block;
}

.toast.success {
    background: hsl(143 85% 96%);
    color: hsl(140 100% 27%);
    border-color: hsl(143 85% 88%);
}
.toast.error {
    background: hsl(0 93% 94%);
    color: hsl(0 84% 60%);
    border-color: hsl(0 93% 88%);
}
.toast.info {
    background: hsl(214 95% 93%);
    color: hsl(214 84% 45%);
    border-color: hsl(214 95% 85%);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Footer */
footer {
    background: hsl(var(--card));
    border-top: 1px solid hsl(var(--border));
    color: hsl(var(--muted-foreground));
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
}

footer p {
    margin: 0.25rem 0;
    font-size: 0.875rem;
}

footer a {
    color: hsl(var(--primary));
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
}

/* Section titles */
.section h2 {
    color: hsl(var(--foreground));
    font-weight: 600;
    border-bottom: 1px solid hsl(var(--border));
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
}

/* Info callout */
.info-callout {
    background: hsl(var(--muted) / 0.5);
    border: 1px solid hsl(var(--border));
    border-left: 3px solid hsl(var(--primary));
    padding: 1rem;
    margin: 1.25rem 0;
    border-radius: calc(var(--radius) - 2px);
}

.info-callout h4 {
    color: hsl(var(--foreground));
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.info-callout p {
    color: hsl(var(--muted-foreground));
    margin: 0.25rem 0;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
    header .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    header .header-logo {
        height: 40px;
    }
    
    header .header-text h1 {
        font-size: 1.25rem;
    }
    
    header .header-text p {
        font-size: 0.8125rem;
    }
    
    .section {
        padding: 1.25rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Login Card */
.text-center {
    text-align: center;
}

.login-card {
    max-width: 600px;
    margin: 4rem auto;
    padding: 4rem 3rem;
    background: white;
    border: 2px solid hsl(var(--primary));
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.login-card h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: hsl(var(--foreground));
}

.login-card p {
    color: hsl(var(--muted-foreground));
    margin-bottom: 2rem;
    font-size: 1.125rem;
    line-height: 1.6;
}

/* Button Variants */
.btn-large {
    padding: 1.25rem 3rem;
    font-size: 1.25rem;
    min-width: 320px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
    transition: all 0.3s ease;
}

.btn-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

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

.btn-logout {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    background: transparent;
    color: hsl(var(--foreground));
    border: 1px solid hsl(var(--border));
}

.btn-logout:hover {
    background: hsl(var(--muted));
}
