/* ==========================================
   MercyV Regelwerk Styles
   ========================================== */

/* Rules Hero Section */
.rules-hero {
    position: relative;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 0 80px;
    overflow: hidden;
}

.rules-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        var(--primary-dark) 0%,
        var(--bg-darker) 50%,
        var(--bg-dark) 100%);
    z-index: -2;
}

.rules-hero-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
}

.rules-hero-bg::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to top, var(--bg-dark), transparent);
}

.rules-hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.rules-hero-content h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rules-hero-content p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Rules Section */
.rules-section {
    padding: 60px 0 100px;
    background: var(--bg-dark);
}

/* Rules Tabs */
.rules-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    justify-content: center;
    flex-wrap: wrap;
}

.rules-tab {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rules-tab i {
    font-size: 1.1rem;
}

.rules-tab:hover {
    border-color: var(--primary);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.rules-tab.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
}

/* Rules Content */
.rules-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.rules-content.active {
    display: block;
}

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

/* Rules Header */
.rules-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.rules-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.rules-version {
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Rules Intro */
.rules-intro {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 3rem;
}

.rules-intro h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.rules-intro p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.rules-intro p:last-child {
    margin-bottom: 0;
}

.rules-notice {
    padding: 1rem 1.5rem;
    background: rgba(139, 92, 246, 0.1);
    border-left: 3px solid var(--primary);
    border-radius: 0 8px 8px 0;
    margin-top: 1.5rem !important;
    font-style: italic;
}

/* Rules Category */
.rules-category {
    margin-bottom: 3rem;
}

.category-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.category-title .paragraph {
    color: var(--primary);
    font-weight: 700;
}

/* Rule Block */
.rule-block {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.rule-block:hover {
    border-color: var(--primary-dim);
    transform: translateX(5px);
}

.rule-block h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rule-block h4::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.rule-block ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rule-block li {
    position: relative;
    padding-left: 1.5rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rule-block li:last-child {
    border-bottom: none;
}

.rule-block li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

.rule-block li strong {
    color: var(--text-primary);
}

.rule-block p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.rule-block p:last-child {
    margin-bottom: 0;
}

/* Rule Warning */
.rule-warning {
    color: #ef4444 !important;
    font-weight: 500;
}

.rule-warning::before {
    color: #ef4444 !important;
}

/* Rule Table */
.rule-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.rule-table th,
.rule-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border: 1px solid var(--border-color);
}

.rule-table th {
    background: rgba(139, 92, 246, 0.1);
    color: var(--text-primary);
    font-weight: 600;
}

.rule-table td {
    color: var(--text-secondary);
}

.rule-table tr:hover td {
    background: rgba(139, 92, 246, 0.05);
}

/* Checkmarks and X marks */
.rule-block li.allowed::before {
    content: '✓';
    color: #22c55e;
}

.rule-block li.forbidden::before {
    content: '✗';
    color: #ef4444;
}

/* Sub-rules list */
.sub-rules {
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border-color);
}

.sub-rules li {
    font-size: 0.95rem;
}

/* Rules Footer */
.rules-footer {
    margin-top: 4rem;
    padding: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    text-align: center;
}

.rules-footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.rules-footer a {
    color: var(--primary);
    text-decoration: none;
}

.rules-footer a:hover {
    text-decoration: underline;
}

/* Star Rating System Table */
.star-table {
    overflow-x: auto;
    margin-top: 1rem;
}

.star-table table {
    width: 100%;
    min-width: 600px;
}

.star-table .stars {
    color: #fbbf24;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
    .rules-hero {
        padding: 100px 0 60px;
        min-height: auto;
    }

    .rules-tabs {
        flex-direction: column;
    }

    .rules-tab {
        width: 100%;
        justify-content: center;
    }

    .rules-header {
        flex-direction: column;
        text-align: center;
    }

    .rule-block {
        padding: 1.25rem;
    }

    .rule-block:hover {
        transform: none;
    }

    .category-title {
        font-size: 1.25rem;
    }

    .rules-intro {
        padding: 1.5rem;
    }

    .rule-table {
        font-size: 0.85rem;
    }

    .rule-table th,
    .rule-table td {
        padding: 0.5rem;
    }
}

/* Scrollbar for tables */
.star-table::-webkit-scrollbar {
    height: 8px;
}

.star-table::-webkit-scrollbar-track {
    background: var(--bg-darker);
    border-radius: 4px;
}

.star-table::-webkit-scrollbar-thumb {
    background: var(--primary-dim);
    border-radius: 4px;
}

.star-table::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Print Styles */
@media print {
    .navbar,
    .rules-tabs,
    footer {
        display: none !important;
    }

    .rules-content {
        display: block !important;
        page-break-before: always;
    }

    .rules-content:first-of-type {
        page-break-before: avoid;
    }

    .rule-block {
        break-inside: avoid;
    }

    body {
        background: white;
        color: black;
    }

    .rules-hero {
        background: #f3f4f6;
        -webkit-print-color-adjust: exact;
    }
}
