* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
    color: #1a1a1a;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Segoe UI', Roboto, sans-serif;
    font-weight: 700;
}

h1 {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    line-height: 1.2;
    background: linear-gradient(135deg, #800000 0%, #6e0303 50%, #000000 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    line-height: 1.2;
    background: linear-gradient(135deg, #1a1a1a 0%, #800000 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h3 {
    font-size: 1.1rem;
    color: #1a1a1a;
}

p {
    color: #4a4a4a;
    line-height: 1.7;
}

a {
    text-decoration: none;
    color: inherit;
}

/* PORTAL LINKS FINAL */
.portal-links-final {
    display: flex;
    height: 100vh;
}

.page-wrapper-final {
    display: flex;
    width: 100%;
}

/* SIDEBAR - Modern Design */
.sidebar-final {
    width: 280px;
    background: linear-gradient(135deg, #800000 0%, #6e0303 50%, #000000 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(128, 0, 0, 0.2);
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header-final {
    padding: 2rem 1.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo-final img {
    width: 100%;
    max-width: 200px;
    height: auto;
    filter: brightness(1.1);
    transition: transform 0.3s ease;
}

.sidebar-logo-final:hover img {
    transform: scale(1.05);
}

.sidebar-scrollable-content-final {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.sidebar-nav-final ul {
    list-style: none;
}

.sidebar-nav-final li {
    margin: 0;
}

.sidebar-nav-final a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.85);
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    font-weight: 500;
}

.sidebar-nav-final a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-left-color: #ffff00;
    transform: translateX(4px);
}

.sidebar-nav-final a.active {
    background: rgba(255, 255, 255, 0.15);
    color: #ffff00;
    border-left-color: #ffff00;
    box-shadow: inset 0 0 10px rgba(255, 255, 0, 0.1);
}

.sidebar-nav-icon-final {
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* MAIN CONTENT - Modern Layout */
.main-content-final {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.top-bar-final {
    background: linear-gradient(135deg, #800000 0%, #6e0303 50%, #000000 100%);
    color: #ffffff;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(128, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-bar-final h1 {
    color: #ffffff;
    background: none;
    -webkit-text-fill-color: unset;
    font-size: 1.8rem;
}

.top-bar-final h1::before {
    content: '🗝️ ';
    margin-right: 0.5rem;
}

.container-final {
    flex: 1;
    padding: 3rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* SECTION TITLES */
.section-title-final {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid;
    border-image: linear-gradient(135deg, #800000 0%, #6e0303 50%, #000000 100%) 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title-final::before {
    content: '';
    width: 6px;
    height: 2rem;
    background: linear-gradient(to bottom, #800000, #6e0303);
    border-radius: 3px;
    box-shadow: 0 4px 12px rgba(128, 0, 0, 0.2);
}

/* GRID LAYOUT */
.grid-final {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .grid-final {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-final {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* CARDS - Modern Design */
.card-final {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem;
    border: 2px solid #e0e0e0;
    border-radius: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.card-final::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(128, 0, 0, 0.05) 0%, rgba(110, 3, 3, 0.02) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.card-final:hover {
    border-color: #800000;
    box-shadow: 0 12px 30px rgba(128, 0, 0, 0.15);
    transform: translateY(-8px);
}

.card-final:hover::before {
    opacity: 1;
}

.card-icon-final {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    transition: transform 0.3s ease;
}

.card-final:hover .card-icon-final {
    transform: scale(1.2) rotate(5deg);
}

.card-final h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: #1a1a1a;
    transition: color 0.3s ease;
    position: relative;
    z-index: 2;
}

.card-final:hover h3 {
    background: linear-gradient(135deg, #800000 0%, #6e0303 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-final p {
    font-size: 0.9rem;
    color: #666666;
    line-height: 1.6;
    position: relative;
    z-index: 2;
}

/* RULE CARDS - Maintain Original Colors */
.rule-card-final {
    border: 2px solid #e0e0e0;
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    position: relative;
    overflow: hidden;
}

.rule-card-final::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.03) 0%, rgba(0, 0, 0, 0.01) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.rule-card-final:hover {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    transform: translateY(-6px);
}

.rule-card-final:hover::before {
    opacity: 1;
}

.rule-card-header-final {
    padding: 1.25rem;
    font-weight: 700;
    font-size: 1rem;
    color: #ffffff;
    text-align: center;
    border-bottom: 3px solid rgba(0, 0, 0, 0.1);
}

.rule-card-content-final {
    padding: 1.5rem;
    flex: 1;
    position: relative;
    z-index: 2;
}

.rule-card-content-final ol {
    list-style-position: inside;
    color: #4a4a4a;
    line-height: 1.8;
}

.rule-card-content-final li {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.rule-card-content-final li::marker {
    color: #800000;
    font-weight: 700;
}

/* Original Color Classes */
.material-escritorio-final .rule-card-header-final {
    background: linear-gradient(135deg, #ff8f4f 0%, #c95a00 100%);
}

.insumos-final .rule-card-header-final {
    background: linear-gradient(135deg, #4ECDC4 0%, #003a86 100%);
}

.uniformes-final .rule-card-header-final {
    background: linear-gradient(135deg, #97ff5b 0%, #0f4b00 100%);
}

.contra-peso-final .rule-card-header-final {
    background: linear-gradient(135deg, #1a0077 0%, #7CCDB5 100%);
}

.borracharia-final .rule-card-header-final {
    background: linear-gradient(135deg, #ffdd19 0%, #885800 100%);
}

/* RESPONSIVE DESIGN */
@media (max-width: 1024px) {
    .sidebar-final {
        width: 250px;
    }

    .main-content-final {
        margin-left: 250px;
    }

    .container-final {
        padding: 2rem 1.5rem;
    }

    .grid-final {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar-final {
        width: 100%;
        height: auto;
        position: relative;
        box-shadow: 0 4px 15px rgba(128, 0, 0, 0.1);
    }

    .main-content-final {
        margin-left: 0;
    }

    .sidebar-scrollable-content-final {
        display: none;
    }

    .sidebar-scrollable-content-final.active {
        display: block;
    }

    .container-final {
        padding: 1.5rem 1rem;
    }

    .grid-final {
        grid-template-columns: 1fr;
    }

    .card-final {
        padding: 1.5rem;
    }

    .card-icon-final {
        font-size: 2.5rem;
    }

    .top-bar-final {
        padding: 1.5rem;
    }

    .top-bar-final h1 {
        font-size: 1.4rem;
    }

    .section-title-final {
        font-size: 1.25rem;
    }
}

/* ANIMATIONS */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.card-final {
    animation: fadeIn 0.6s ease-out;
}

.rule-card-final {
    animation: fadeIn 0.6s ease-out;
}

.sidebar-nav-final a {
    animation: slideInLeft 0.5s ease-out;
}

/* SCROLLBAR STYLING */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #800000, #6e0303);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #6e0303, #800000);
}

/* ACCESSIBILITY */
button:focus-visible,
a:focus-visible {
    outline: 3px solid #ffff00;
    outline-offset: 2px;
}

/* UTILITY CLASSES */
.gradient-text {
    background: linear-gradient(135deg, #800000 0%, #6e0303 50%, #000000 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-bg {
    background: linear-gradient(135deg, #800000 0%, #6e0303 50%, #000000 100%);
}

.shadow-lg {
    box-shadow: 0 12px 30px rgba(128, 0, 0, 0.15);
}

.transition-all {
    transition: all 0.3s ease;
}
