/* Tommy Hegarty - Unified Master Stylesheet */
/* Based on original style.css appearance */

/* === GLOBAL RESET & BASE STYLES === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    content: "text/html; charset=UTF-8";
}

@import url('https://fonts.googleapis.com/css2?family=Forum&family=Poppins:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    background-color: skyblue;
    color: #555;
    padding: 5%;
    content: en;
}

html {
    scroll-behavior: smooth;
}

/* Headings use Forum font and black color */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Forum', serif;
    color: black;
}

/* === GLOBAL ANIMATIONS === */
@keyframes cycleCards {
    0% {
        opacity: 0;
        z-index: 1;
    }
    100% {
        opacity: 1;
        z-index: 2;
    }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* === CONTAINERS === */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

.gallery-container {
    padding: 2% 5%;
    background-color: skyblue;
    min-height: 100vh;
}

/* === HEADERS === */
.header, .gallery-header {
    background-color: white;
    border: 3px solid black;
    border-radius: 30px;
    box-shadow: 0 4px 8px darkslategrey;
    text-align: center;
    padding-top: 6%;
    padding-bottom: 6%;
    margin-bottom: 5vh;
    position: relative;
    overflow: hidden;
    align-self: stretch;
    scroll-margin-top: 2vh;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><defs><pattern id="grain" width="100" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="5" r="0.5" fill="rgba(255,255,255,0.1)"/><circle cx="30" cy="15" r="0.3" fill="rgba(255,255,255,0.08)"/><circle cx="60" cy="8" r="0.4" fill="rgba(255,255,255,0.06)"/><circle cx="80" cy="12" r="0.2" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="20" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.header h1, .gallery-header h1 {
    font-family: 'Forum', serif;
    color: black;
    position: relative;
    z-index: 1;
}

.header p {
    color: #555;
    position: relative;
    z-index: 1;
}

/* === NAVIGATION === */
.navigation {
    border: 3px solid black;
    border-radius: 30px;
    background-color: white;
    box-shadow: 0 4px 8px darkslategrey;
    padding-top: 6%;
    padding-bottom: 6%;
    text-align: center;
    margin-bottom: 5vh;
    align-self: stretch;
    scroll-margin-top: 2vh;
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 4%;
}

.nav-link {
    color: #555;
    text-decoration: none;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: black;
    color: white;
    transform: translateY(-2px);
}

.nav-link.active {
    background: black;
    color: white;
}

/* === LAYOUT SYSTEMS === */
.wrapper {
    display: flex;
    justify-content: space-between;
    font-family: 'Poppins', sans-serif;
}

.main {
    justify-content: space-between;
    display: flex;
    flex-direction: column;
    row-gap: 5vh;
    width: 74%;
    height: fit-content;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 5vh;
    margin-top: 0;
}

/* === SECTIONS === */
section {
    align-self: stretch;
    scroll-margin-top: 2vh;
    border: 3px solid black;
    border-radius: 30px;
    background-color: white;
    box-shadow: 0 4px 8px darkslategrey;
    padding-top: 6%;
    padding-bottom: 6%;
}

.content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5vh;
    padding: 2%;
}

.title {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 50%;
    height: 100%;
}

.description {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
}

/* === VISUALIZATION SECTION === */
.visualization-section {
    border: 3px solid black;
    border-radius: 30px;
    background-color: white;
    box-shadow: 0 4px 8px darkslategrey;
    padding-top: 6%;
    padding-bottom: 6%;
    position: relative;
    overflow: hidden;
    align-self: stretch;
    scroll-margin-top: 2vh;
}

.visualization-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139,69,19,0.03) 0%, transparent 70%);
    animation: rotate 30s linear infinite;
    z-index: 0;
}

.section-title {
    font-family: 'Forum', serif;
    color: black;
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

/* === CARDS === */
.card, .project-card, .stat-card, .gallery-card, .topic-card {
    border: 1px solid black;
    border-radius: 8px;
    box-shadow: 0 4px 8px skyblue;
    background-color: white;
    transition: all 0.3s ease;
    padding: 8px;
}

.card:hover, .project-card:hover, .stat-card:hover, .gallery-card:hover, .topic-card:hover {
    box-shadow: 0 8px 16px skyblue;
}

/* Project cards */
.project-cards {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    column-gap: 20px;
    row-gap: 40px;
}

.project-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

.project-link {
    text-decoration: none;
    color: inherit;
}

.project-title {
    font-family: 'Forum', serif;
    color: black;
    font-size: large;
}

.project-description {
    font-size: small;
}

/* Stats */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 5vh;
}

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

.stat-number {
    font-family: 'Forum', serif;
    font-weight: bold;
    color: black;
    line-height: 1;
}

.stat-label {
    color: #555;
    margin-top: 0.5rem;
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    padding: 0;
    margin-top: 3rem;
}

.gallery-card {
    overflow: hidden;
    padding: 0;
}

.gallery-card img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
}

.gallery-card.landscape {
    grid-column: span 2;
}

.gallery-card.landscape img {
    height: 100%;
    object-fit: cover;
}

.fade-in {
    opacity: 0;
    animation: fadeIn 0.5s ease-in forwards;
}

/* Topic cards - display as grid like project cards */
.topic-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.topic-card {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.topic-rank {
    background: #2c5530;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-weight: bold;
    min-width: fit-content;
}

.topic-name {
    font-family: 'Forum', serif;
    font-weight: bold;
    color: black;
    flex: 1;
    min-width: 200px;
}

.topic-strength {
    color: #555;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.topic-category {
    color: #555;
    font-style: italic;
}

.key-terms {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.term {
    background: rgba(44, 85, 48, 0.1);
    padding: 0.25rem 0.6rem;
    border-radius: 15px;
    color: #2c5530;
    border: 1px solid rgba(44, 85, 48, 0.2);
}

.method-badge {
    background: #2c5530;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-weight: bold;
    font-family: 'Forum', serif;
    display: inline-block;
    margin-bottom: 1rem;
}

/* === SIDEBAR === */
.sidebar-wrapper {
    width: 20%;
    height: fit-content;
    position: sticky;
    position: -webkit-sticky;
    top: 5%;
    justify-content: space-between;
    display: flex;
    flex-direction: column;
    row-gap: 5vh;
}

.sidebar {
    border: 3px solid black;
    border-radius: 10px;
    padding: 10%;
    background-color: #fff;
    box-shadow: 0 4px 8px darkslategrey;
    height: fit-content;
    float: left;
}

.sidebar h3 {
    font-family: 'Forum', serif;
    color: black;
    margin-bottom: 1rem;
}

.sidebar-content {
    min-height: 200px;
}

.contact {
    font-size: medium;
}

/* === BUBBLE CLOUD === */
.bubble-cloud {
    position: relative;
    width: 100%;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: auto;
}


/* === UTILITY CLASSES === */
.italic {
    font-style: italic;
}

.smaller-italic {
    font-style: italic;
    font-size: smaller;
}

.no-selection {
    color: #555;
    font-style: italic;
    text-align: center;
    margin: 2rem 0;
}

/* === LISTS === */
.education-list {
    list-style-type: none;
    font-size: small;
}

.side-list {
    padding: 3px;
    list-style-type: none;
    vertical-align: middle;
}

.reading-list {
    padding: 5px;
    list-style-type: none;
    vertical-align: middle;
    font-size: small;
}

/* === BUTTONS === */
.link-list {
    padding-top: 30px;
    padding-bottom: 30px;
}

.permanent-button span {
    display: flex;
    width: fill;
}

.rolling-button {
    background-color: grey;
    border-radius: 5px;
    color: white;
    padding: 1% 2%;
    text-align: left;
    text-decoration: none;
    width: 65%;
    display: flex;
    align-items: center;
    column-gap: 6px;
    justify-content: space-between;
    transition: all 0.2s ease-in-out;
}

.rolling-button span {
    display: flex;
    width: fill;
}

.rolling-button:hover {
    width: 90%;
    background-color: skyblue;
    transition: width 2s ease;
    border: 1px solid black;
    box-shadow: 0 2px 4px grey;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 2rem auto;
    background-color: white;
    border: 1px solid black;
    border-radius: 8px;
    box-shadow: 0 4px 8px skyblue;
    padding: 1rem;
    max-width: 400px;
}

.page-btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid black;
    border-radius: 8px;
    background: white;
    font-family: 'Forum', serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-btn:hover:not(:disabled) {
    box-shadow: 0 8px 16px skyblue;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-family: 'Forum', serif;
    font-weight: bold;
}

.loading, .error {
    text-align: center;
    padding: 1rem;
    font-family: 'Forum', serif;
}

.loading-card {
    max-width: 400px;
    margin: 2rem auto;
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #555;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
    .header h1, .gallery-header h1 {
        font-size: 2.2rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    .stats-section {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    
    .topic-card {
        padding: 1rem;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .topic-name {
        min-width: auto;
        font-size: 1rem;
    }
    
    .sidebar {
        position: static;
        order: -1;
        width: auto;
        min-width: auto;
    }

    .nav-links {
        flex-direction: column;
        gap: 1rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-card.landscape {
        grid-column: span 1;
    }
    
    .wrapper {
        flex-direction: column;
        gap: 2rem;
    }
    
    .main {
        width: 100%;
    }
    
    .sidebar-wrapper {
        width: 100%;
        position: static;
    }
    
    .project-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}