/* === SUNY Oneonta Brightspace Theme === */
:root {
    --primary: #C41E3A;
    --primary-dark: #9a1729;
    --primary-darker: #8B1528;
    --text-dark: #1a1a1a;
    --text-muted: #5b5b6e;
    --bg-light: #f8f8f8;
    --bg-card: #ffffff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f8f8f8 0%, #ffffff 100%);
    margin: 0;
    padding: 2rem 1rem;
    box-sizing: border-box;
    min-height: 100vh;
}

.main-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    align-items: start;
}

/* === INFO CARD (LEFT) === */
.info-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 8px 28px rgba(196, 30, 58, 0.12);
    border-top: 4px solid var(--primary);
    border-left: 4px solid var(--primary);
}

.info-card h1 {
    margin: 0 0 0.25rem 0;
    font-size: 1.8rem;
    color: var(--primary);
    letter-spacing: -0.3px;
    font-weight: 700;
}

.info-card .subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    border-left: 4px solid var(--primary);
    padding-left: 0.75rem;
    font-weight: 500;
}

.info-card .semester {
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0 0 1.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.intro-title {
    color: var(--primary);
    font-size: 1.2rem;
    margin: 1.5rem 0 0.8rem 0;
    font-weight: 700;
}

.intro-text {
    color: var(--text-dark);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0 0 1.2rem 0;
}

.course-title,
.learning-outcomes-title,
.team-title {
    color: var(--primary);
    font-size: 1rem;
    margin: 1.2rem 0 0.6rem 0;
    font-weight: 700;
}

.course-description {
    color: var(--text-dark);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0 0 1rem 0;
    font-style: italic;
}

.learning-intro {
    color: var(--text-dark);
    font-size: 0.9rem;
    margin: 0 0 0.6rem 0;
    font-weight: 500;
}

.learning-list {
    margin: 0.5rem 0 1.2rem 1.5rem;
    padding: 0;
    list-style-type: decimal;
}

.learning-list li {
    color: var(--text-dark);
    font-size: 0.9rem;
    margin: 0.4rem 0;
    line-height: 1.5;
}

.team-container {
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.05) 0%, rgba(196, 30, 58, 0.02) 100%);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(196, 30, 58, 0.1);
    margin: 0.8rem 0;
}

.team-member {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
    font-size: 0.9rem;
}

.team-member:last-child {
    margin-bottom: 0;
}

.member-role {
    font-weight: 700;
    color: var(--primary);
    min-width: 100px;
}

.member-name,
.member-names {
    color: var(--text-dark);
}

/* === Collaborator Links === */
.collaborator-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    padding-bottom: 2px;
}

.collaborator-link:hover {
    border-bottom-color: var(--primary);
    color: var(--primary-dark);
}

.collaborator-link:active {
    color: var(--primary-darker);
}

/* Collaborator Modal Styling */
.collaborator-modal-content {
    text-align: center;
    padding: 2.5rem;
}

#collaboratorName {
    margin: 0 0 1.5rem 0;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.8rem;
}

.collaborator-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.collaborator-contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.collaborator-contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.25);
}

.linkedin-btn:hover {
    background: var(--primary);
    color: white;
}

.email-btn:hover {
    background: var(--primary);
    color: white;
}

.btn-icon {
    font-size: 1.2rem;
}

/* === CIPHER CARD (RIGHT) === */
.cipher-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 8px 28px rgba(196, 30, 58, 0.12);
    border-top: 4px solid var(--primary);
    border-right: 4px solid var(--primary);
}

.cipher-card-title {
    margin: 0 0 1.5rem 0;
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 700;
    text-align: center;
}

/* start section (text + dropdown) */
.start-section {
    margin-bottom: 1.8rem;
}

.start-section input,
.start-section select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    box-sizing: border-box;
    background: white;
    transition: all 0.2s;
}

.start-section input:focus,
.start-section select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

.start-section label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-dark);
    display: block;
    margin-bottom: 0.3rem;
}

/* cipher container & sections */
.cipher-container {
    margin-top: 0.5rem;
}

.cipher-section {
    display: none;
    margin-bottom: 1.5rem;
    animation: fadeIn 0.2s;
}

.cipher-section h3 {
    font-size: 1.1rem;
    margin: 0 0 0.8rem 0;
    color: var(--primary);
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    font-weight: 700;
}

.math-label {
    font-size: 0.7rem;
    font-weight: normal;
    background: rgba(196, 30, 58, 0.08);
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    color: var(--primary);
    font-family: monospace;
    border: 1px solid rgba(196, 30, 58, 0.15);
}

.cipher-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.cipher-section input {
    width: 100%;
    padding: 10px 12px;
    margin: 0.5rem 0 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    box-sizing: border-box;
    transition: all 0.2s;
}

.cipher-section input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

.button-group {
    display: flex;
    gap: 0.75rem;
    margin: 1rem 0 1rem;
}

button {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    flex: 1;
    box-shadow: 0 2px 8px rgba(196, 30, 58, 0.15);
}

button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.25);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(196, 30, 58, 0.15);
}

button:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* result box */
.result-box {
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.08) 0%, rgba(196, 30, 58, 0.04) 100%);
    color: var(--primary);
    padding: 1.2rem;
    border-radius: 12px;
    min-height: 60px;
    word-break: break-word;
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 1.5rem;
    border: 2px solid rgba(196, 30, 58, 0.15);
    line-height: 1.5;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
}

.result-box:empty {
    display: none;
}

/* simple fade animation */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(5px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Learn Button */
.learn-btn {
    background: none;
    border: 2px solid var(--primary);
    font-size: 0.75rem;
    color: var(--primary);
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 20px;
    transition: all 0.15s;
    flex-shrink: 0;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: none;
}

.learn-btn:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(196, 30, 58, 0.25);
    transform: translateY(-1px);
}

.learn-btn:active {
    transform: translateY(0);
}

/* === Modal Styles === */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalFadeIn 0.3s ease;
    border-top: 6px solid var(--primary);
}

@keyframes modalFadeIn {
    from { 
        opacity: 0; 
        transform: translateY(-30px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.close-modal {
    position: absolute;
    top: 18px;
    right: 22px;
    font-size: 32px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.close-modal:hover {
    color: var(--primary);
    transform: scale(1.2);
}

#modalTitle {
    margin: 0 0 1.5rem 0;
    color: var(--primary);
    border-bottom: 3px solid var(--primary);
    padding-bottom: 12px;
    font-weight: 700;
    font-size: 1.5rem;
}

#modalBody {
    line-height: 1.7;
    font-size: 0.95rem;
    color: var(--text-dark);
}

#modalBody p {
    margin: 1rem 0;
}

#modalBody h3 {
    color: var(--primary);
    margin: 1.5rem 0 0.5rem 0;
    font-weight: 700;
}

#modalBody .formula {
    background: rgba(196, 30, 58, 0.08);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.95rem;
    display: block;
    color: var(--primary);
    border: 2px solid rgba(196, 30, 58, 0.2);
    margin: 0.8rem 0;
    overflow-x: auto;
}

#modalBody ul, #modalBody ol {
    margin: 0.8rem 0;
    padding-left: 1.5rem;
}

#modalBody li {
    margin: 0.5rem 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .info-card,
    .cipher-card {
        max-width: 600px;
        margin: 0 auto;
    }
}

@media (max-width: 640px) {
    body {
        padding: 1rem 0.5rem;
    }
    
    .info-card,
    .cipher-card {
        padding: 1.5rem;
        border-radius: 12px;
    }
    
    .cipher-card-title {
        font-size: 1.3rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    button {
        width: 100%;
    }
    
    .cipher-section h3 {
        font-size: 1rem;
    }
}
