/* ===================================
   OMMI-Quiz Styles
   Responsive Design fÃ¼r Desktop & Mobile
   =================================== */

/* === Reset & Base Styles === */
* {
    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, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    color: #333;
}

/* === Container === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* === Header === */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

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

.subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    font-weight: 300;
}

/* === Topic Section === */
.topic-section {
    padding: 40px 30px;
}

.topic-title {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.topic-icon {
    font-size: 2.5rem;
}

.topic-description {
    color: #666;
    margin-bottom: 40px;
    font-size: 1.1rem;
    line-height: 1.8;
}

/* === Cards Grid === */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* === Card Styles === */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 2px solid #f0f0f0;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    text-align: center;
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.card-body {
    padding: 25px;
    flex-grow: 1;
}

.card-description {
    color: #555;
    margin-bottom: 20px;
    line-height: 1.6;
}

.card-features {
    list-style: none;
    margin-bottom: 20px;
}

.card-features li {
    padding: 8px 0;
    color: #666;
    font-size: 0.95rem;
}

.card-footer {
    padding: 0 25px 25px 25px;
}

.card-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1.05rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.card-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.button-arrow {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.card-button:hover .button-arrow {
    transform: translateX(5px);
}

/* === Info Section === */
.info-section {
    padding: 0 30px 40px 30px;
}

.info-box {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.info-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.info-list {
    list-style: none;
    counter-reset: info-counter;
}

.info-list li {
    counter-increment: info-counter;
    padding: 12px 0 12px 45px;
    position: relative;
    font-size: 1.05rem;
    line-height: 1.6;
}

.info-list li::before {
    content: counter(info-counter);
    position: absolute;
    left: 0;
    top: 8px;
    background: rgba(255, 255, 255, 0.3);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

/* === Footer === */
.footer {
    background: #f8f9fa;
    padding: 25px;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    border-top: 2px solid #e9ecef;
}

/* ===================================
   Ãœbungsseiten Styles
   =================================== */

.solution-box {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.solution-box.show {
    max-height: 2000px;
    transition: max-height 0.5s ease-in;
}

.fraction {
    display: inline-block;
    text-align: center;
    vertical-align: middle;
}

.fraction > span {
    display: block;
    padding: 0 5px;
}

.fraction > span:first-child {
    border-bottom: 1px solid #000;
}

.gate-box {
    display: inline-block;
    padding: 8px 16px;
    background: #3b82f6;
    color: white;
    font-weight: bold;
    border-radius: 4px;
    margin: 0 4px;
}

.state-box {
    display: inline-block;
    padding: 8px 16px;
    background: #8b5cf6;
    color: white;
    font-weight: bold;
    border-radius: 4px;
    margin: 0 4px;
}

/* ===================================
   Quiz-Card Styles
   =================================== */

.quiz-card {
    position: relative;
}

.quiz-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 18px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.quiz-card:hover::before {
    opacity: 1;
}

.quiz-card:hover {
    border-color: #10b981;
}

.quiz-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

.quiz-button {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

.quiz-button:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5) !important;
}

.quiz-card .card-icon {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* ===================================
   Responsive Design fÃ¼r Mobile
   =================================== */

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 12px;
    }

    .header {
        padding: 30px 20px;
    }

    .main-title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .topic-section {
        padding: 30px 20px;
    }

    .topic-title {
        font-size: 1.5rem;
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .topic-icon {
        font-size: 2rem;
    }

    .topic-description {
        font-size: 1rem;
        margin-bottom: 30px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .card-header {
        padding: 20px;
    }

    .card-icon {
        font-size: 2.5rem;
    }

    .card-title {
        font-size: 1.3rem;
    }

    .card-body {
        padding: 20px;
    }

    .card-description {
        font-size: 0.95rem;
    }

    .card-features li {
        font-size: 0.9rem;
        padding: 6px 0;
    }

    .card-footer {
        padding: 0 20px 20px 20px;
    }

    .card-button {
        padding: 12px 20px;
        font-size: 1rem;
    }

    .info-section {
        padding: 0 20px 30px 20px;
    }

    .info-box {
        padding: 25px 20px;
    }

    .info-title {
        font-size: 1.3rem;
        text-align: center;
        margin-bottom: 15px;
    }

    .info-list li {
        padding: 10px 0 10px 40px;
        font-size: 0.95rem;
    }

    .info-list li::before {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }

    .footer {
        padding: 20px 15px;
        font-size: 0.85rem;
    }

    /* Mobile-Anpassungen fÃ¼r Ãœbungsseiten */
    .gate-box,
    .state-box {
        padding: 6px 12px;
        font-size: 0.9rem;
        margin: 2px;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .topic-title {
        font-size: 1.3rem;
    }

    .card-icon {
        font-size: 2rem;
    }

    .card-title {
        font-size: 1.2rem;
    }

    .info-list li {
        padding-left: 35px;
        font-size: 0.9rem;
    }

    .info-list li::before {
        width: 26px;
        height: 26px;
        font-size: 0.95rem;
    }
}

/* ===================================
   Animations & Transitions
   =================================== */

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

.card {
    animation: fadeIn 0.5s ease-out;
}

.card:nth-child(1) {
    animation-delay: 0.1s;
}

.card:nth-child(2) {
    animation-delay: 0.2s;
}

.card:nth-child(3) {
    animation-delay: 0.3s;
}

/* ===================================
   Print Styles
   =================================== */

@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
        border-radius: 0;
    }

    .card {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .card-button {
        display: none;
    }
}