@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&display=swap');

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

body {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 900px;
    width: 90%;
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Larger container for ranking page */
.container.ranking-page {
    max-width: 1400px;
    width: 95%;
    padding: 50px;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin-bottom: 20px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #333;
    transition: width 0.3s ease;
}

/* Question Counter */
.question-counter {
    font-size: 14px;
    color: #666;
    margin-bottom: 30px;
    font-weight: 500;
}

/* Form Elements */
.survey-form h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.question-description {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    text-align: center;
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    margin-bottom: 30px;
    transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
    outline: none;
    border-color: #333;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Clickable Card Options - Image as Card with Text */
.card-group {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: nowrap;
}

/* Vertical layout for text-only options (like age) */
.card-group.vertical {
    flex-direction: column;
    align-items: center;
    max-width: 400px;
    margin: 0 auto 30px;
}

.card-option {
    position: relative;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    width: 240px;
    height: 400px;
}

.card-option:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border-color: #666;
}

.card-option:hover .card-tooltip {
    opacity: 1;
    max-height: 200px;
}

.card-option.selected {
    border-color: #333;
    border-width: 1px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: translateY(-8px);
}

.card-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

/* Image takes up 60% of card height */
.card-image-container {
    height: 65%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.card-option:hover{
    filter: brightness(0.95);
}

/* Text takes up 40% of card height */
.card-text {
    height: 40%;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background: white;
    overflow-y: auto;
}

.card-title {
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
    font-weight: 600;
}

.card-tooltip {
    font-family: 'Lato', sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #666;
    line-height: 1.3;
    margin-bottom: 5px;
    opacity: 0;
    transition: opacity 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

/* Simple text option for non-image cards */
.simple-text-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-size: 32px;
    font-weight: 700;
    font-family: 'Lato', sans-serif;
    color: #333;
    text-align: center;
    height: 100%;
    width: 100%;
}

/* Vertical text options styling */
.card-group.vertical .card-option {
    width: 100%;
    max-width: 400px;
    height: auto;
    min-height: 60px;
}

.card-group.vertical .simple-text-option {
    font-size: 18px;
    font-weight: 400;
    justify-content: flex-start;
    padding-left: 40px;
}

/* Ranking Interface */
.ranking-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.ranking-instructions {
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    text-align: center;
    padding: 15px;
    background: #f8f8f8;
    border-radius: 8px;
}

/* Cards grid - 4x2 layout */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.ranking-card {
    position: relative;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    width: 100%;
    height: 300px;
}

.ranking-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #666;
}

.ranking-card:hover .card-tooltip {
    opacity: 1;
    max-height: 200px;
}

/* Image takes up 70% of card height */
.ranking-card .card-image-container {
    height: 70%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
}

.ranking-card .card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

/* Rank badge - centered overlay */
.rank-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 700;
    color: #333;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 5;
}

/* Show rank badge when card is ranked */
.ranking-card.ranked {
    background: rgba(200, 200, 200, 0.3);
}

.ranking-card.ranked .rank-badge {
    opacity: 1;
}

/* Text takes up 30% of card height */
.ranking-card .card-text {
    height: 30%;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: white;
    overflow-y: auto;
}

.ranking-card .card-title {
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-align: center;
    line-height: 1.3;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #333;
    color: white;
}

.btn-primary:hover {
    background: #555;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* Start Page */
.start-content {
    text-align: center;
    padding: 40px 0;
}

.start-content h1 {
    font-size: 48px;
    margin-bottom: 30px;
    color: #333;
    font-weight: 700;
}

.start-content p {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

.start-content .btn {
    margin-top: 20px;
}

/* Thank You Page */
.thank-you-content {
    text-align: center;
    padding: 40px 0;
}

.thank-you-content h1 {
    font-size: 32px;
    margin-bottom: 20px;
    color: #333;
}

.thank-you-content p {
    font-size: 18px;
    color: #666;
    margin-bottom: 15px;
}

.thank-you-content .btn {
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 30px 20px;
    }
    
    .survey-form h1 {
        font-size: 20px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}
