:root {
    --primary-color: #4f46e5;
    --secondary-color: #4338ca;
    --background-color: #f8fafc;
    --text-color: #1e293b;
    --success-color: #22c55e;
    --warning-color: #eab308;
    --danger-color: #ef4444;
    --border-color: #e2e8f0;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    min-height: 100vh;
}

header {
    background-color: transparent;
    box-shadow: none;
    padding: 1.5rem 2rem;
    position: relative;
    backdrop-filter: none;
    margin-bottom: 1rem;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem 4rem;
}

.hero {
    text-align: center;
    margin-bottom: 4rem;
    padding-top: 2rem;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
    animation: fadeIn 0.8s ease-out;
}

.hero p {
    font-size: 1.5rem;
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
    animation: fadeIn 0.8s ease-out 0.2s backwards;
}

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

.form-container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
    transition: var(--transition-base);
    border: 1px solid var(--border-color);
}

.form-container.hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
    position: absolute;
    visibility: hidden;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group:last-of-type {
    margin-bottom: 2rem;
}

input[type="text"],
select,
textarea {
    width: 100%;
    padding: 0.875rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: var(--transition-base);
    background-color: #f8fafc;
}

input[type="text"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    background-color: white;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%231e293b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.5em;
    padding-right: 2.5rem;
}

button {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

button:active {
    transform: translateY(0);
}

textarea {
    width: 100%;
    height: 150px;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    resize: vertical;
}

.analysis-status {
    display: none;
    margin-top: 2rem;
}

.progress-container {
    margin: 4rem auto;
    max-width: 600px;
    position: relative;
    padding: 3rem 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.progress-container.visible {
    opacity: 1;
    transform: translateY(0);
}

.progress-bar {
    position: absolute;
    top: calc(50% - 8px);
    left: 50%;
    width: calc(100% - 120px);
    height: 3px;
    background: var(--border-color);
    z-index: 1;
    transform: translate(-50%, -50%);
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: var(--primary-color);
    transition: width 0.5s ease;
}

.progress-steps {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    padding: 0 40px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.step-icon {
    width: 48px;
    height: 48px;
    background: white;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text-color);
    transition: all 0.3s ease;
    position: relative;
    z-index: 3;
    margin-bottom: 16px;
}

.step-icon::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--primary-color) var(--progress), transparent var(--progress));
    -webkit-mask: radial-gradient(farthest-side, transparent 62%, black 63%);
    mask: radial-gradient(farthest-side, transparent 62%, black 63%);
    transition: opacity 0.3s;
    opacity: 0;
}

.progress-step.active .step-icon::before {
    opacity: 1;
    --progress: 100%;
    animation: spin 1.5s linear infinite;
}

@keyframes spin {
    to { 
        transform: rotate(360deg);
    }
}

.step-text {
    position: absolute;
    width: max-content;
    left: 50%;
    transform: translateX(-50%);
    top: calc(100% + 8px);
    font-size: 0.875rem;
    color: var(--text-color);
    font-weight: 500;
}

.progress-step.active .step-icon {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.progress-step.completed .step-icon {
    border-color: var(--success-color);
    background: var(--success-color);
    color: white;
}

.progress-step.completed .step-icon::before {
    animation: none;
    opacity: 0;
}

/* Progress bar states */
.progress-container[data-progress="1"] .progress-bar::before { width: 0%; }
.progress-container[data-progress="2"] .progress-bar::before { width: 50%; }
.progress-container[data-progress="3"] .progress-bar::before { width: 100%; }

.results {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    display: none;
}

.results.visible {
    opacity: 1;
    transform: translateY(0);
}

.results h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-color);
    font-size: 1.75rem;
    font-weight: 600;
}

.results-container {
    background-color: white;
    padding: 2.5rem;
    border-radius: 1.25rem;
    box-shadow: var(--card-shadow);
    margin-top: 2rem;
    border: 1px solid var(--border-color);
}

.video-info {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 2fr;
    gap: 1.75rem;
    margin-bottom: 2rem;
    padding-bottom: 1.75rem;
    border-bottom: 2px solid var(--background-color);
}

#videoThumbnail img {
    width: 100%;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

#videoDetails h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    color: var(--text-color);
    font-weight: 600;
}

.video-stats {
    display: flex;
    gap: 1.25rem;
    margin-top: 0.75rem;
    color: var(--text-color);
    font-size: 0.875rem;
    opacity: 0.85;
}

.safety-analysis {
    display: grid;
    gap: 2rem;
}

.analysis-section {
    background-color: white;
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition-base);
}

.analysis-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.1);
}

.analysis-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background-color: #f8fafc;
}

.analysis-header h3 {
    font-size: 1.125rem;
    color: var(--text-color);
    margin: 0;
    font-weight: 600;
}

.analysis-content {
    padding: 1.25rem;
}

.analysis-description {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--text-color);
}

.status-badge {
    margin-left: 1rem;
    flex-shrink: 0;
}

.meta-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.meta-info:empty {
    display: none;
}

#concerns {
    order: 3;
    margin-top: 0;
}

#concerns ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    margin: 0;
}

#concerns li {
    background-color: var(--background-color);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    color: var(--text-color);
    font-weight: 500;
}

#recommendations {
    order: 2;
    margin-top: 0;
}

#safetyScore {
    order: 1;
}

.meta-info-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.meta-info-label {
    font-weight: 600;
    color: var(--text-color);
}

.meta-info-value {
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-weight: 500;
    font-size: 0.8125rem;
    background-color: var(--background-color);
}

.approved, .not-approved {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.8125rem;
}

.approved {
    color: var(--success-color);
    background-color: rgba(34, 197, 94, 0.1);
}

.not-approved {
    color: var(--danger-color);
    background-color: rgba(239, 68, 68, 0.1);
}

.confidence-high, .confidence-medium, .confidence-low {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-weight: 500;
    font-size: 0.8125rem;
}

.confidence-high {
    color: var(--success-color);
    background-color: rgba(34, 197, 94, 0.1);
}

.confidence-medium {
    color: var(--warning-color);
    background-color: rgba(234, 179, 8, 0.1);
}

.confidence-low {
    color: var(--danger-color);
    background-color: rgba(239, 68, 68, 0.1);
}

@media (max-width: 768px) {
    main {
        padding: 2rem 1rem 3rem;
    }

    .hero {
        margin-bottom: 2.5rem;
        padding-top: 1rem;
    }

    .hero h1 {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }

    .hero p {
        font-size: 1.125rem;
        padding: 0 1rem;
    }

    .form-container {
        padding: 1.5rem;
        margin: 0 1rem;
    }

    .input-group {
        margin-bottom: 1.25rem;
    }

    input[type="text"],
    select,
    textarea {
        padding: 0.75rem 1rem;
        font-size: 0.9375rem;
    }

    .progress-container {
        margin: 3rem auto;
        padding: 2rem 0;
    }

    .progress-steps {
        padding: 0 20px;
    }

    .step-icon {
        width: 40px;
        height: 40px;
        font-size: 0.875rem;
    }

    .step-text {
        font-size: 0.75rem;
        width: 80px;
        text-align: center;
    }

    .cancel-button {
        bottom: -3rem;
        padding: 0.625rem 1.5rem;
        font-size: 0.8125rem;
    }

    .results-container {
        padding: 1.5rem;
    }

    .video-info {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        margin-bottom: 1.75rem;
        padding-bottom: 1.5rem;
    }

    #videoThumbnail {
        max-width: 400px;
        margin: 0 auto;
    }

    .meta-info {
        flex-direction: column;
        gap: 0.75rem;
    }

    .meta-info-item {
        width: 100%;
        justify-content: space-between;
    }

    .analysis-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .status-badge {
        margin-left: 0;
    }

    #concerns ul {
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .form-container {
        padding: 1.25rem;
        margin: 0 0.5rem;
    }

    .progress-steps {
        padding: 0 10px;
    }

    .step-icon {
        width: 36px;
        height: 36px;
    }

    .step-text {
        font-size: 0.6875rem;
        width: 70px;
    }

    .video-stats {
        flex-direction: column;
        gap: 0.5rem;
    }

    .meta-info {
        gap: 0.5rem;
    }

    #concerns ul {
        gap: 0.375rem;
    }

    #concerns li {
        font-size: 0.8125rem;
        padding: 0.375rem 0.75rem;
    }

    .modal-content {
        width: 95%;
        margin: 0.5rem;
    }

    .modal-header h2 {
        font-size: 1.125rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-body h3 {
        font-size: 1rem;
    }

    .modal-body p,
    .modal-body li {
        font-size: 0.875rem;
    }
}

@media (max-width: 360px) {
    .hero h1 {
        font-size: 1.75rem;
    }

    .form-container {
        padding: 1rem;
        margin: 0 0.25rem;
    }

    .checkbox-container {
        font-size: 0.8125rem;
        padding-left: 1.75rem;
    }

    .checkmark {
        width: 1.125rem;
        height: 1.125rem;
    }

    .step-icon {
        width: 32px;
        height: 32px;
    }

    .step-text {
        font-size: 0.625rem;
        width: 60px;
    }
}

.custom-guidelines {
    transition: all 0.3s ease;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
}

.custom-guidelines.active {
    opacity: 1;
    max-height: 200px;
}

.cancel-button {
    position: absolute;
    bottom: -4rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 0.75rem 2rem;
    background-color: white;
    color: var(--text-color);
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    white-space: nowrap;
    width: auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.cancel-button.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.cancel-button:hover {
    background-color: #f8fafc;
    border-color: var(--text-color);
    color: var(--text-color);
}

.cancel-button:active {
    background-color: #f1f5f9;
    transform: translateX(-50%) translateY(1px);
}

footer {
    text-align: center;
    padding: 3rem 2rem;
    color: #64748b;
    background-color: white;
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
}

.video-link {
    margin-top: 1.25rem;
}

.video-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition-base);
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.video-button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.video-button:active {
    transform: translateY(0);
}

.video-button::before {
    content: '';
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 12a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

#safetyScore {
    order: 1;
}

#recommendations {
    order: 2;
}

#concerns {
    order: 3;
}

@media (max-width: 768px) {
    .video-link {
        margin-top: 1rem;
    }

    .video-button {
        width: 100%;
        justify-content: center;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: white;
    border-radius: 1rem;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    position: relative;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
}

.close-button {
    position: absolute;
    right: 1rem;
    top: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.close-button:hover {
    background-color: #f1f5f9;
    color: var(--text-color);
}

.modal-body {
    padding: 1.25rem;
}

.modal-body h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 1.25rem 0 0.75rem;
}

.modal-body h3:first-child {
    margin-top: 0;
}

.modal-body p {
    margin-bottom: 0.75rem;
    line-height: 1.5;
    color: var(--text-color);
    font-size: 0.9375rem;
}

.modal-body .intro {
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 1.25rem;
}

.modal-body ul {
    margin: 0.75rem 0;
    padding-left: 1.25rem;
    list-style-type: disc;
    color: var(--text-color);
}

.modal-body li {
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.modal-body li:last-child {
    margin-bottom: 0;
}

/* Terms Acceptance Styles */
.terms-acceptance {
    margin: 1.5rem 0;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    position: relative;
    padding-left: 2rem;
    cursor: pointer;
    font-size: 0.9rem;
    user-select: none;
    color: #64748b;
    line-height: 1.4;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    left: 0;
    top: 0;
    height: 1.25rem;
    width: 1.25rem;
    background-color: #f8fafc;
    border: 2px solid var(--border-color);
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.checkbox-container:hover .checkmark {
    border-color: var(--primary-color);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.link-button {
    display: inline;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: var(--primary-color);
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease;
}

.link-button:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

button[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

@media (max-width: 640px) {
    .modal {
        padding: 0.5rem;
    }

    .modal-content {
        width: 100%;
        max-height: 90vh;
    }

    .modal-header {
        padding: 1.25rem;
    }

    .close-button {
        right: 1rem;
        top: 1rem;
    }

    .modal-body {
        padding: 1.25rem;
    }

    .checkbox-container {
        font-size: 0.85rem;
    }
}

.info-icon {
    display: inline-block;
    margin-left: 5px;
    cursor: pointer;
    color: #666;
    font-size: 14px;
    transition: color 0.2s ease;
}

.info-icon:hover {
    color: #007bff;
}

.blurred-thumbnail {
    filter: blur(10px);
}

.thumbnail-container {
    position: relative;
    display: inline-block;
}

.reveal-button {
    max-width: 100px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.8);
    color: var(--text-color);
    border: none;
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.reveal-button:hover {
    background-color: rgba(255, 255, 255, 0.9);
    transform: translate(-50%, -50%);
}