/* Primer Design System Styles */
/* Based on GitHub's Primer design system - https://primer.style/ */

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

:root {
    /* Primer Color Palette */
    --color-canvas-default: #ffffff;
    --color-canvas-subtle: #f6f8fa;
    --color-border-default: #d0d7de;
    --color-border-muted: #d8dee4;
    --color-fg-default: #24292f;
    --color-fg-muted: #57606a;
    --color-fg-subtle: #6e7781;
    --color-primer-border-active: #fd7e14;
    --color-primer-canvas-backdrop: rgba(27, 31, 36, 0.5);
    --color-btn-primary-bg: #2da44e;
    --color-btn-primary-hover-bg: #2c974b;
    --color-btn-primary-disabled-bg: #94d3a2;
    --color-accent-emphasis: #0969da;
    --color-danger-fg: #cf222e;
    --color-success-fg: #1a7f37;
    
    /* Spacing */
    --base-size-4: 0.25rem;
    --base-size-8: 0.5rem;
    --base-size-12: 0.75rem;
    --base-size-16: 1rem;
    --base-size-20: 1.25rem;
    --base-size-24: 1.5rem;
    --base-size-32: 2rem;
    --base-size-40: 2.5rem;
    
    /* Typography */
    --fontStack: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    --fontStack-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

body {
    font-family: var(--fontStack);
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-fg-default);
    background: linear-gradient(135deg, #f6f8fa 0%, #eaeef2 50%, #d0d7de 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated Background with Primer Colors */
.water-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.wave {
    position: absolute;
    width: 200%;
    height: 200px;
    background: linear-gradient(90deg, 
        rgba(208, 215, 222, 0.15) 0%, 
        rgba(218, 227, 234, 0.2) 50%, 
        rgba(208, 215, 222, 0.15) 100%);
    border-radius: 50%;
    animation: wave-animation 15s infinite linear;
}

.wave:nth-child(1) {
    bottom: -50px;
    left: -50%;
    animation-duration: 20s;
    opacity: 0.5;
}

.wave:nth-child(2) {
    bottom: -80px;
    left: -50%;
    animation-duration: 25s;
    animation-direction: reverse;
    opacity: 0.35;
    background: linear-gradient(90deg, 
        rgba(9, 105, 218, 0.08) 0%, 
        rgba(84, 174, 255, 0.12) 50%, 
        rgba(9, 105, 218, 0.08) 100%);
}

.wave:nth-child(3) {
    bottom: -110px;
    left: -50%;
    animation-duration: 30s;
    opacity: 0.25;
    background: linear-gradient(90deg, 
        rgba(110, 119, 129, 0.1) 0%, 
        rgba(208, 215, 222, 0.15) 50%, 
        rgba(110, 119, 129, 0.1) 100%);
}

@keyframes wave-animation {
    0% {
        transform: translateX(0) translateY(0) rotate(0deg);
    }
    50% {
        transform: translateX(-25%) translateY(-20px) rotate(180deg);
    }
    100% {
        transform: translateX(-50%) translateY(0) rotate(360deg);
    }
}

/* Floating particles with Primer colors */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(9, 105, 218, 0.3);
    border-radius: 50%;
    animation: float 20s infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(50px);
        opacity: 0;
    }
}

.container {
    position: relative;
    z-index: 1;
    max-width: 1012px;
    margin: 0 auto;
    padding: var(--base-size-24) var(--base-size-16);
}

/* Header */
.header {
    margin-bottom: var(--base-size-24);
    position: relative;
}

.header-content {
    text-align: center;
    padding: var(--base-size-40) var(--base-size-24);
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-border-default);
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(27, 31, 36, 0.08);
}

.header-title {
    font-size: 32px;
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: var(--base-size-16);
    color: var(--color-fg-default);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--base-size-12);
    flex-wrap: wrap;
}

.header-icon {
    font-size: 32px;
    display: inline-block;
    margin-right: var(--base-size-8);
    filter: grayscale(0%);
}

.header-description {
    font-size: 16px;
    color: var(--color-fg-muted);
    margin-bottom: var(--base-size-12);
}

.header-note {
    font-size: 14px;
    color: var(--color-fg-subtle);
    margin-top: var(--base-size-16);
}

/* Labels */
.Label {
    display: inline-block;
    padding: 0 var(--base-size-8);
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
    border-radius: 2em;
    border: 1px solid transparent;
}

.Label--secondary {
    color: var(--color-fg-muted);
    background-color: var(--color-canvas-subtle);
    border-color: var(--color-border-default);
}

/* Links */
.Link {
    color: var(--color-accent-emphasis);
    text-decoration: none;
}

.Link:hover {
    text-decoration: underline;
}

/* Box Component (Primer's Card) */
.Box {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-border-default);
    border-radius: 6px;
    margin-bottom: var(--base-size-16);
    box-shadow: 0 1px 3px rgba(27, 31, 36, 0.08);
}

.Box--condensed {
    border-radius: 6px;
}

.Box-header {
    padding: var(--base-size-12) var(--base-size-16);
    background-color: rgba(246, 248, 250, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border-default);
    border-radius: 6px 6px 0 0;
}

.Box-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-fg-default);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--base-size-8);
}

.box-icon {
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.Box-body {
    padding: var(--base-size-16);
}

.Box-body p {
    margin: 0;
    color: var(--color-fg-muted);
    font-size: 14px;
    line-height: 1.5;
}

/* Info Cards Grid */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--base-size-16);
    margin-bottom: var(--base-size-24);
}

/* Form Styles */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--base-size-16);
    margin-bottom: var(--base-size-16);
}

.form-group {
    margin-bottom: var(--base-size-16);
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: var(--base-size-8);
    color: var(--color-fg-default);
    display: flex;
    align-items: center;
    gap: var(--base-size-8);
}

.label-icon {
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    opacity: 0.8;
}

.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: 5px 12px;
    font-size: 14px;
    line-height: 20px;
    color: var(--color-fg-default);
    background-color: var(--color-canvas-default);
    border: 1px solid var(--color-border-default);
    border-radius: 6px;
    transition: border-color 0.2s cubic-bezier(0.3, 0, 0.5, 1);
    font-family: var(--fontStack);
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-accent-emphasis);
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.1);
}

.form-control::placeholder {
    color: var(--color-fg-subtle);
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 32px;
    appearance: none;
}

.form-select option {
    background-color: var(--color-canvas-default);
    color: var(--color-fg-default);
}

.form-actions {
    margin-top: var(--base-size-24);
}

/* Buttons */
.btn {
    position: relative;
    display: inline-block;
    padding: 5px 16px;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid;
    border-radius: 6px;
    appearance: none;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.3, 0, 0.5, 1);
    font-family: var(--fontStack);
}

.btn-primary {
    color: #ffffff;
    background-color: var(--color-btn-primary-bg);
    border-color: rgba(27, 31, 36, 0.15);
    box-shadow: 0 1px 0 rgba(27, 31, 36, 0.1);
}

.btn-primary:hover {
    background-color: var(--color-btn-primary-hover-bg);
    border-color: rgba(27, 31, 36, 0.15);
    box-shadow: 0 1px 0 rgba(27, 31, 36, 0.1);
}

.btn-primary:active {
    background-color: #298e46;
    box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.1);
}

.btn-block {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: var(--base-size-8);
}

.btn-icon {
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

/* Progress Container */
.progress-container {
    display: none;
    margin-top: var(--base-size-24);
    padding: var(--base-size-16);
    background-color: var(--color-canvas-subtle);
    border: 1px solid var(--color-border-default);
    border-radius: 6px;
}

.progress-bar-wrapper {
    display: flex;
    align-items: center;
    gap: var(--base-size-12);
}

.progress {
    flex: 1;
    height: 8px;
    border-radius: 10px;
    background-color: var(--color-canvas-subtle);
    border: none;
    overflow: hidden;
}

.progress::-webkit-progress-bar {
    background-color: var(--color-canvas-subtle);
    border-radius: 10px;
}

.progress::-webkit-progress-value {
    background-color: var(--color-accent-emphasis);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress::-moz-progress-bar {
    background-color: var(--color-accent-emphasis);
    border-radius: 10px;
}

.progress-text {
    font-family: var(--fontStack-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-fg-muted);
    min-width: 40px;
    text-align: right;
}

/* Output */
.output {
    background-color: var(--color-canvas-subtle);
    border: 1px solid var(--color-border-default);
    border-radius: 6px;
    padding: var(--base-size-16);
    font-family: var(--fontStack-mono);
    font-size: 12px;
    line-height: 1.45;
    color: var(--color-fg-default);
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 500px;
    overflow-y: auto;
    margin: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border-default) transparent;
}

.output::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.output::-webkit-scrollbar-track {
    background: transparent;
}

.output::-webkit-scrollbar-thumb {
    background-color: var(--color-border-default);
    border-radius: 4px;
}

.output::-webkit-scrollbar-thumb:hover {
    background-color: var(--color-border-muted);
}

.output.error {
    color: var(--color-danger-fg);
    border-color: var(--color-danger-fg);
}

/* Footer */
.footer {
    margin-top: var(--base-size-40);
    padding: var(--base-size-24);
    text-align: center;
    border-top: 1px solid var(--color-border-default);
    color: var(--color-fg-muted);
    font-size: 12px;
}

.footer p {
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: var(--base-size-16) var(--base-size-12);
    }

    .header-content {
        padding: var(--base-size-24) var(--base-size-16);
    }

    .header-title {
        font-size: 24px;
        flex-direction: column;
        align-items: center;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .info-cards {
        grid-template-columns: 1fr;
    }
}

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid var(--color-accent-emphasis);
    outline-offset: 2px;
}

.btn:focus-visible {
    outline-offset: 2px;
}

