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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #380D75 0%, #2E0B5C 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.content-layout {
    display: flex;
    gap: 40px;
    align-items: stretch;
    justify-content: center;
}

.content-layout > * {
    flex-shrink: 0;
}

.interaction-column {
    flex: 0 0 420px;
    max-width: 480px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.header .subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    font-weight: 300;
    margin-bottom: 15px;
}

/* GitLab Branding */
.branding {
    margin-top: 20px;
    text-align: center;
}

.branding-text {
    font-size: 0.9rem;
    color: white;
    margin-bottom: 12px;
    font-weight: 500;
    opacity: 0.9;
}

.duo-logo-form {
    max-width: 280px;
    width: 100%;
    height: auto;
    margin: 0 auto;
    display: block;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.duo-logo-form:hover {
    opacity: 1;
}

.form-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    width: 100%;
}

.oauth-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.gitlab-oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 16px;
    border-radius: 10px;
    border: 2px solid rgba(103, 79, 187, 0.12);
    background: linear-gradient(135deg, #FC6D26 0%, #FCA326 100%);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(252, 109, 38, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.gitlab-oauth-btn svg {
    flex-shrink: 0;
}

.gitlab-oauth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(252, 109, 38, 0.45);
}

.gitlab-oauth-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
    box-shadow: none;
    filter: grayscale(12%);
}

.oauth-divider {
    text-align: center;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #718096;
    font-weight: 600;
}

.oauth-status {
    text-align: center;
    font-size: 0.9rem;
    color: #4a5568;
    min-height: 1.2em;
}

.oauth-status.error {
    color: #E53E3E;
}

.oauth-status.success {
    color: #2F855A;
}

.form-card.hidden {
    opacity: 0;
    transform: translateY(-20px) scale(0.8);
    pointer-events: none;
    max-height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.branding.hidden {
    display: none;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #f7fafc;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

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

.loading-container {
    margin-top: 12px;
    text-align: center;
    width: 100%;
}

.loading-bar {
    width: 100%;
    max-width: 300px;
    height: 6px;
    background: rgba(107, 79, 187, 0.2);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    margin: 0 auto;
}

.loading-bar-fill {
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, #6B4FBB 0%, #764ba2 100%);
    border-radius: 3px;
    animation: loading-slide 1.2s ease-in-out infinite;
}

@keyframes loading-slide {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(350%);
    }
}

.result-container {
    display: none;
    text-align: center;
    flex: 1 1 0;
    min-width: 0;
}

.result-container.visible {
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fadeInUp 0.6s ease;
    align-items: stretch;
}

.generation-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

.badge-ai {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.badge-keyword {
    background: linear-gradient(135deg, #FCA326 0%, #FC6D26 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(252, 163, 38, 0.4);
}

.refresh-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    text-align: center;
    width: 100%;
    max-width: 500px;
}

.refresh-prompt p {
    margin: 0;
    font-size: 0.95rem;
}

.refresh-prompt #refreshCountdown {
    font-weight: 700;
    color: #FCA326;
}

.refresh-btn {
    padding: 10px 24px;
    background: #FCA326;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.refresh-btn:hover:not(:disabled) {
    background: #FC6D26;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(252, 163, 38, 0.4);
}

.refresh-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-wrapper {
    background: white;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    margin-bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

#agentCard {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.download-btn, .reset-btn {
    padding: 14px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.download-btn {
    background: linear-gradient(135deg, #FC6D26 0%, #FCA326 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(252, 109, 38, 0.4);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(252, 109, 38, 0.6);
}

.reset-btn {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.reset-btn:hover {
    background: #667eea;
    color: white;
}

/* Canvas for card generation */
#cardCanvas {
    display: none;
}

/* GitLab Branding */
.branding {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.branding-text {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 12px;
    font-weight: 500;
}

#formBranding {
    background: none;
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

#formBranding .branding-text {
    color: white;
}

#formBranding .duo-logo-form {
    opacity: 1;
}

.gitlab-logomark {
    display: block;
    margin: 0 auto;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.gitlab-logomark:hover {
    opacity: 1;
}

/* Share Section */
.share-section {
    margin-top: 25px;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.share-text {
    font-size: 1rem;
    color: #4a5568;
    margin-bottom: 15px;
    font-weight: 600;
    text-align: center;
}

.share-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.share-btn svg {
    flex-shrink: 0;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

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

.share-x {
    background: #000000;
}

.share-x:hover {
    background: #1a1a1a;
}

.share-bluesky {
    background: #0085ff;
}

.share-bluesky:hover {
    background: #0070dd;
}

.share-linkedin {
    background: #0077b5;
}

.share-linkedin:hover {
    background: #006399;
}

@media (max-width: 600px) {
    .content-layout {
        gap: 24px;
    }

    .card-wrapper {
        padding: 16px;
    }

    .header h1 {
        font-size: 2rem;
    }
    
    .duo-logo-form {
        max-width: 200px;
    }
    
    .form-card {
        padding: 10px 10px;
    }

    .oauth-actions {
        gap: 10px;
    }

    .gitlab-oauth-btn {
        padding: 12px;
        font-size: 0.95rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .download-btn, .reset-btn {
        width: 100%;
    }
    
    .share-buttons {
        flex-direction: column;
    }
    
    .share-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 1024px) {
    .content-layout {
        flex-direction: column;
        justify-content: flex-start;
    }

    .interaction-column {
        flex: 1 1 auto;
    }

    .result-container.visible {
        width: 100%;
    }
}
