/* Base styles */
html, body {
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    position: fixed;
    width: 100%;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #f6f9fc 0%, #edf2f7 100%);
    color: #2d3748;
    display: flex;
    flex-direction: column;
}

#main-content {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    background-color: white;
    padding: 1rem;
    transition: all 0.3s ease;
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Roboto', sans-serif;
    margin-bottom: 1.5rem;
    color: #1a365d;
    letter-spacing: -0.025em;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(45deg, #2b6cb0, #4299e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
    font-size: 2.25rem;
    color: #2d3748;
}

p {
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
    color: #4a5568;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    padding: 1rem 2rem;
    margin-bottom: 0.5rem;
    background-color: #ffffff;
    color: #2d3748;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 48px;
    min-width: 48px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

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

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

.btn-primary {
    background: linear-gradient(135deg, #4299e1 0%, #2b6cb0 100%);
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2b6cb0 0%, #2c5282 100%);
}

.btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform .5s, opacity 1s;
}

.btn:active::after {
    transform: scale(0, 0);
    opacity: .3;
    transition: 0s;
}

.btn-yes {
    background-color: #4CAF50;
    color: white;
}

.btn-no {
    background-color: #F44336;
    color: white;
}

.btn-yes:hover, .btn-no:hover {
    filter: brightness(90%);
}

.flex-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}

/* Forms */
.form-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.input-wrapper {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

.input-wrapper input,
.input-wrapper select {
    width: 100%;
}

select, input {
    width: 100%;
    padding: 0.875rem 1rem;
    margin-bottom: 1.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1.125rem;
    background-color: #f8fafc;
    color: #2d3748;
    transition: all 0.3s ease;
    height: 52px;
    box-sizing: border-box;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
    line-height: 1.2;
}

select:focus, input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

select:hover, input:hover {
    border-color: #cbd5e0;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%232d3748' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 3rem;
    padding-top: 0;
    padding-bottom: 0;
}

/* Results */
#results {
    background-color: #fff;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

/* Utility classes */
.hidden {
    display: none;
}

.text-center {
    text-align: center;
}

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }

/* Tailwind-like utility classes */
.mx-auto { margin-left: auto; margin-right: auto; }
.w-full { width: 100%; }
.max-w-xs { max-width: 100%; }
.block { display: block; }

/* Full-screen layout */
#test-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

#item-container {
    text-align: center;
}

#home-page {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    width: 100%;
    text-align: center;
    padding: 0.5rem;
    overflow: hidden;
}

.footer {
    width: 100%;
    padding: 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: #64748b;
    margin-top: auto;
}

@media (min-width: 768px) and (max-width: 1024px) {
    .footer {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
}

/* Make images responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Make the results table responsive */
table {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    display: block;
    table-layout: fixed;
}

th, td {
    padding: 0.75rem;
    text-align: center;
}

/* Responsive styles optimized for tablets */
@media (min-width: 768px) and (max-width: 1024px) {
    #main-content {
        margin: 0;
        padding: 0.75rem;
    }

    #home-page {
        padding: 0.5rem;
    }

    h1 {
        font-size: 2.25rem;
        margin-bottom: 0.75rem;
    }

    h2 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    p {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .mb-8 {
        margin-bottom: 0.75rem;
    }

    .input-wrapper {
        max-width: 90%;
    }

    select, input {
        font-size: 1.2rem;
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }
}

/* Landscape tablet optimization */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    #main-content {
        padding: 1.5rem;
    }

    #home-page {
        padding: 1.5rem;
    }

    .btn {
        width: auto;
        min-width: 200px;
    }
}

/* Portrait tablet optimization */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    #main-content {
        padding: 0.5rem;
    }

    #home-page {
        padding: 0.25rem;
    }

    select, input {
        padding: 0.5rem 0.75rem;
        margin-bottom: 0.5rem;
    }

    .mb-8 {
        margin-bottom: 0.5rem;
    }
}

/* Mobile styles */
@media (max-width: 767px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 0.8rem 1.6rem;
        font-size: 1rem;
        width: 100%;
    }

    #main-content {
        margin: 0;
        padding: 1rem;
        border-radius: 0;
    }
}

/* Rest of your existing styles... */
.text-blue-600 { color: #2563eb; }
.text-green-600 { color: #16a34a; }
.text-orange-600 { color: #ea580c; }
.text-red-600 { color: #dc2626; }

table, th, td {
    border: 1px solid #e5e7eb;
    border-collapse: collapse;
}

.final-results-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.fullscreen-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #fff;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    z-index: 1000;
}

.overlay-content {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 1rem;
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 0;
}

.overlay-content h2 {
    font-size: 1.5rem;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    margin-bottom: 0.5rem;
}

.overlay-content p {
    font-size: 1rem;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    margin-bottom: 1rem;
}

.button-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    width: 100%;
}

@media (orientation: landscape) {
    .fullscreen-container {
        background-size: contain;
    }
}

@media (orientation: portrait) {
    .fullscreen-container {
        background-size: contain;
    }
}

@media (max-width: 768px) {
    .overlay-content {
        padding: 0.5rem;
    }
    
    .overlay-content h2 {
        font-size: 1.2rem;
    }
    
    .overlay-content p {
        font-size: 0.9rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
}
