/* Reset default styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
}

/* Navigation Panel Styling */
.top-nav {
    background-color: #333;
    color: #fff;
    padding: 0.5rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.nav-container {
    max-width: 95%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    position: relative;
    min-height: 60px;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-links li {
    padding: 0 1rem;
}

.mobile-only {
    display: none;
}

.nav-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-decoration: none;
    z-index: 1002;
}

.nav-logo img {
    height: 52px;
    display: block;
    transition: transform 0.3s ease;
}

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1002;
}

.nav-tagline {
    font-size: 0.7rem;
    color: #ccc;
    font-weight: normal;
    margin-top: 10px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-logo:hover img {
    transform: scale(1.05);
}

.nav-logo:hover .nav-tagline {
    color: #f39c12;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
    text-transform: uppercase;
}

.nav-links a:hover,
.nav-links a.active {
    color: #f39c12;
}

/* Language Switcher Dropdown Styling */
.lang-switcher {
    margin-left: 1rem;
}

.dropbtn {
    background-color: transparent;
    color: white;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: bold;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.dropbtn:hover {
    border-color: #f39c12;
    color: #f39c12;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: block;
    opacity: 0;
    visibility: hidden;
    position: absolute;
    right: 0;
    background-color: #333;
    min-width: 140px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.3);
    z-index: 1001;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.dropdown-content::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    height: 15px;
    background: transparent;
}

.dropdown-content a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.95rem;
    font-weight: normal;
    transition: background-color 0.2s ease;
}

.dropdown-content a:hover {
    background-color: #444;
    color: #f39c12 !important;
}

.dropdown:hover .dropdown-content,
.dropdown.show .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown:hover .dropbtn,
.dropdown.show .dropbtn {
    color: #f39c12;
}

/* Main Wrapper & Sidebar Layout */
.main-wrapper {
    max-width: 95%;
    margin: 100px auto 20px auto;
    display: flex;
    gap: 20px;
    padding: 0 10px;
}

.sidebar-column {
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 100px;
    height: fit-content;
}

#notifications-sidebar {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header-link {
    text-decoration: none;
    display: block;
}

.sidebar-header-link:hover h3 {
    color: #f39c12 !important;
}

#notifications_header {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f39c12;
}

.notif-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.notif-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.notif-title {
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 0.3rem;
}

.notif-date {
    display: block;
    font-size: 0.82rem;
    color: #999;
    margin-bottom: 0.4rem;
}

.notif-body {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.4;
    margin: 0;
}

.notif-body p {
    margin: 0.25em 0;
}

.notif-body p:last-child {
    margin-bottom: 0;
}

.notif-body ul,
.notif-body ol {
    margin: 0.25em 0;
    padding-left: 1.4em;
}

.notif-body li {
    margin: 0.15em 0;
}

.notif-body p:empty {
    display: none;
}

.notif-toggle-btn {
    background: none;
    border: none;
    color: #f39c12;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: bold;
    padding: 0;
    margin-top: 0.75rem;
    display: block;
}

.notif-toggle-btn:hover {
    text-decoration: underline;
}

.notif-message {
    font-size: 0.9rem;
    color: #888;
}

.notif-more-link {
    display: block;
    margin-top: 1rem;
    font-size: 0.88rem;
    font-weight: bold;
    color: #f39c12;
    text-decoration: none;
}

.notif-more-link:hover {
    text-decoration: underline;
}

.full-notif-item,
.full-notif-item:last-child {
    background-color: #fcfcfc;
    padding: 1.5rem;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.full-notif-item .notif-title {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.full-notif-item .notif-body {
    font-size: 1.05rem;
    line-height: 1.6;
}

/* Main Content Styling */
main#content {
    flex: 1;
    max-width: none;
    margin: 0;
    padding: 2rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-height: 60vh;
}

/* Headers */
main#content h1 {
    font-size: 2.2rem;
    color: #333;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #f39c12;
    text-align: left;
    scroll-margin-top: 100px;
}

/* Hero Header Styling (Homepage) */
.hero-header {
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('images/etusivu.jpg');
    background-size: cover;
    background-position: center;
    padding: 2rem;
    margin: 0 0 3rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    text-align: center;
    border-radius: 12px;
    box-shadow: inset 0 0 100px rgba(0,0,0,0.2);
}

.hero-header h1 {
    color: #fff !important;
    font-size: 3.5rem !important;
    text-transform: uppercase;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.6);
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    letter-spacing: 2px;
}

.hero-header a {
    text-decoration: none;
    color: inherit;
}

main#content h2 {
    margin: 2.5rem 0 1.2rem 0;
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
    font-size: 1.8rem;
    scroll-margin-top: 100px;
}

main#content h3 {
    margin: 2rem 0 1rem 0;
    color: #333;
    font-size: 1.5rem;
    scroll-margin-top: 100px;
}

main#content h4 {
    margin: 1.5rem 0 0.8rem 0;
    color: #333;
    font-size: 1.3rem;
    scroll-margin-top: 100px;
}

main#content h5 {
    margin: 1.2rem 0 0.6rem 0;
    color: #333;
    font-size: 1.15rem;
    scroll-margin-top: 100px;
}

main#content h6 {
    margin: 1rem 0 0.5rem 0;
    color: #333;
    font-size: 1.1rem;
    text-transform: uppercase;
    scroll-margin-top: 100px;
}

/* Paragraphs and Lists */
main#content p {
    margin-bottom: 1rem;
    color: #555;
    font-size: 1.1rem;
}

main#content ul {
    margin-bottom: 1rem;
    padding-left: 2rem;
    color: #555;
    font-size: 1.1rem;
}

main#content li {
    margin-bottom: 0.5rem;
}

/* Global Content Quote Styling */
main#content blockquote {
    margin: 3rem auto;
    padding: 2.5rem 2rem 2rem 2rem;
    background-color: #f9f9f9;
    border-left: 5px solid #f39c12;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    font-size: 1.1rem;
    color: #444;
    text-align: center;
    position: relative;
    max-width: 80%;
    line-height: 1.6;
}

main#content blockquote::before {
    content: "\f10d";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 1.8rem;
    color: #f39c12;
    background: #f9f9f9;
    padding: 0 8px;
}

/* Table Styling */
main#content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.82rem;
    overflow-x: auto;
    display: block;
}

main#content th, main#content td {
    border: 2px solid #eee;
    padding: 10px 8px;
    text-align: left;
    min-width: 130px;
    vertical-align: top;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

main#content td:hover {
    background-color: #fff9eb;
    border-color: #f39c12;
}

main#content th {
    background-color: #333;
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.75rem;
    border-color: #444;
}

main#content tr:nth-child(even) {
    background-color: #f9f9f9;
}

.cell-line {
    margin-bottom: 6px;
    line-height: 1.2;
}

.cell-line:last-child {
    margin-bottom: 0;
    color: #888;
    font-size: 0.78rem;
}

/* General Image Styling */
main#content img {
    max-width: 50%;
    height: auto;
    display: block;
    margin: 1.5rem auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

main#content img.full-width {
    max-width: 100% !important;
}

/* Media + Quote Side-by-Side */
.media-quote {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin: 3rem 0;
    flex-wrap: wrap;
}

.media-quote .media-part {
    flex: 1 1 300px;
    max-width: 50%;
}

.media-quote .quote-part {
    flex: 1 1 300px;
}

main#content .media-quote img {
    width: 100%;
    max-width: 100% !important; /* Image fills its 50% container */
    margin: 0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.media-quote blockquote {
    margin: 0 !important;
    max-width: 100% !important;
    padding: 2.5rem 1.5rem 1.5rem 1.5rem !important;
}

/* Sub-navigation Styling */
.sub-nav {
    background-color: transparent;
    padding: 0 0 0.8rem 0;
    border-bottom: 2px solid #f39c12;
    border-radius: 0;
    margin: 0 0 2.5rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    justify-content: center;
}

.sub-nav a {
    color: #333;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    text-transform: uppercase;
}

.sub-nav a i {
    margin-right: 8px;
    font-size: 0.8rem;
    color: inherit;
}

.sub-nav a:hover {
    color: #f39c12;
}

/* Discipline Grid (Homepage) */
.discipline-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Force 3 columns on desktop */
    gap: 1.5rem;
    margin: 2.5rem 0;
}

.discipline-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none; /* Remove underline */
    color: inherit; /* Inherit text color */
}

.discipline-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

main#content .discipline-card img {
    width: 100%;
    height: 280px; /* Taller height for thinner look */
    object-fit: cover;
    display: block;
    margin: 0 !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.discipline-info {
    padding: 1.25rem 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.discipline-info h3 {
    margin: 0 0 0.75rem 0 !important;
    font-size: 1.15rem !important;
    color: #333;
}

.discipline-info p {
    font-size: 0.88rem !important;
    color: #666;
    line-height: 1.4;
    margin: 0 !important;
}

@media (max-width: 900px) {
    .discipline-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

/* Instructor Grid */
.instructor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.peruskurssi-images {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    justify-content: center;
}

.peruskurssi-images img {
    width: 45% !important;
    margin: 0 !important;
}

.instructor-card {
    background: #f9f9f9;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.instructor-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

main#content .instructor-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    object-position: top;
    display: block;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    max-width: 100% !important;
}

.instructor-info {
    padding: 0.85rem 0.75rem 1rem;
}

.instructor-info h3 {
    font-size: 1rem;
    color: #333;
    margin-bottom: 0.5rem;
    border: none;
    padding: 0;
}

.belt-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: bold;
    color: white;
    margin-bottom: 0.5rem;
    letter-spacing: 0.3px;
}

.belt-black { background-color: #1a1a1a; }
.belt-brown { background-color: #7B3F00; }
.belt-purple { background-color: #6B2FA0; }
.belt-blue { background-color: #1565C0; }

.instructor-role {
    font-size: 0.82rem;
    color: #777;
    margin: 0;
    line-height: 1.4;
}

/* Footer Styling */
.main-footer {
    background-color: #333;
    color: #fff;
    padding: 3rem 1rem 1.5rem 1rem;
    margin-top: 2rem;
}

.footer-columns {
    max-width: 95%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-column h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    border-bottom: 1px solid #555;
    padding-bottom: 0.5rem;
}

.footer-column p {
    margin-bottom: 0.5rem;
}

.footer-column a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.footer-column a i {
    margin-right: 8px;
    width: 20px;
    text-align: center;
    color: inherit;
    transition: color 0.3s ease;
}

.footer-column a:hover {
    color: #f39c12;
}

/* Responsive Design */
@media (max-width: 900px) {
    .main-wrapper {
        flex-direction: column;
        margin-top: 80px;
    }

    .sidebar-column {
        flex: 1 0 auto;
        width: 100%;
        position: static;
    }
}

@media (max-width: 768px) {
    .hamburger-btn {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: #333;
        padding: 1rem 0;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 1001;
    }

    .nav-links.show {
        display: flex;
    }

    .nav-links li.mobile-only {
        display: block;
    }

    .sidebar-column {
        display: none;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
        padding: 0.75rem 0;
    }

    .lang-switcher {
        margin-left: 0;
        margin-top: 0.5rem;
    }

    .dropdown-content {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        display: none;
        box-shadow: none;
        margin-top: 0;
    }

    .dropdown.show .dropdown-content {
        display: block;
    }

    .main-wrapper {
        margin-top: 80px;
    }

    main#content img {
        max-width: 80%;
    }

    .media-quote .media-part {
        max-width: 100%;
    }

    .sub-nav {
        gap: 1.5rem;
        padding-bottom: 0.5rem;
    }

    .hero-header {
        padding: 3rem 1rem;
        margin: 0 0 2rem 0;
        min-height: 250px;
        border-radius: 12px;
    }

    .hero-header h1 {
        font-size: 1.8rem !important;
    }
}
