/* Import Ubuntu font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@300;400;500;700&display=swap');

/* Brand Colors */
:root {
    --future-blue: #003C71;
    --simcoe-blue: #0077CA;
    --tech-tangerine: #E75D2A;
    --white: #FFFFFF;
    --light-gray: #F5F5F5;
    --medium-gray: #E0E0E0;
    --dark-gray: #333333;
    --error-red: #D32F2F;
    --success-green: #388E3C;
}

body {
    font-family: Arial, sans-serif; /* Default font as per guidelines */
    line-height: 1.6;
    margin: 0;
    padding: 0;
    color: var(--dark-gray);
    background-color: var(--white);
}

/* Header with logo */
.site-header {
    background-color: var(--white);
    padding: 20px 0;
    border-bottom: 1px solid var(--medium-gray);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

.university-logo {
    height: 100px;
    width: auto;
    display: block;
}

/* Main content wrapper */
.main-content {
    min-height: calc(100vh - 100px);
    padding-bottom: 40px;
}

/* Header styling with primary font */
h1 {
    font-family: 'Ubuntu', Arial, sans-serif;
    color: var(--future-blue);
    font-size: 2.5rem;
    font-weight: 500;
    text-align: center;
    margin: 1rem 1rem 1rem 1rem;
    padding: 0 20px;
}

.description-container{
    display: flex;
    justify-content:center;
    margin-bottom: 1rem;
}

.description{
    max-width: 1000px;
}

/* Container with Future Blue accent */
.cms-form {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px;
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 60, 113, 0.1); /* Future Blue shadow */
    border-top: 4px solid var(--future-blue);
}

/* Form labels with Ubuntu font */
.form-label {
    display: block;
    /* margin-top: 20px; */
    margin-bottom: 8px;
    font-family: 'Ubuntu', Arial, sans-serif;
    font-weight: 500;
    color: var(--future-blue);
    font-size: 1.1rem;
}

/* Form inputs with Simcoe Blue focus */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    margin-top: 5px;
    border: 2px solid var(--medium-gray);
    border-radius: 4px;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--simcoe-blue);
    box-shadow: 0 0 0 3px rgba(0, 119, 202, 0.1);
}

/* Submit button with Tech Tangerine */
.form-submit {
    background-color: var(--tech-tangerine);
    color: var(--white);
    padding: 14px 40px;
    margin-top: 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Ubuntu', Arial, sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.form-submit:hover {
    background-color: #D04E20; /* Darker shade of Tech Tangerine */
    transform: translateY(-2px);
}

.form-submit:active {
    transform: translateY(0);
}

/* Error and success messages */
.error-msg {
    color: var(--error-red);
    font-size: 0.875rem;
    display: block;
    margin-top: 5px;
    font-style: italic;
}

.general-error {
    max-width: 1000px;
    margin: 20px auto;
    padding: 16px 20px;
    background-color: #FFEBEE;
    border-left: 5px solid var(--error-red);
    border-radius: 4px;
    font-style: normal;
}

.success-msg {
    color: var(--success-green);
    font-weight: 500;
    font-family: 'Ubuntu', Arial, sans-serif;
    margin: 20px auto;
    padding: 16px 20px;
    background-color: #E8F5E9;
    border-left: 5px solid var(--success-green);
    max-width: 1000px;
    border-radius: 4px;
}

/* Required field indicator with Tech Tangerine */
.required::after {
    content: ' *';
    color: var(--tech-tangerine);
    font-weight: bold;
}

/* Form groups with better spacing */
.form-group {
    margin-bottom: 24px;
}

/* Radio group styling */
.radio-group {
    margin-top: 12px;
    padding: 12px;
    background-color: var(--light-gray);
    border-radius: 4px;
}

.radio-option {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.radio-option input[type="radio"] {
    margin-right: 8px;
    accent-color: var(--simcoe-blue);
}

.radio-option label {
    font-size: 1rem;
    cursor: pointer;
    color: var(--dark-gray);
}

/* Help text styling */
.help-text {
    font-size: 0.875rem;
    color: #666;
    font-style: italic;
    display: block;
    margin-top: 4px;
}
/* Help text styling - No Italics*/
.help-text-no-italics {
    font-size: 0.875rem;
    color: #666;
    display: block;
    margin-top: 4px;
}

.help-text a {
    color: var(--simcoe-blue);
    text-decoration: underline;
}

.help-text a:hover {
    color: var(--future-blue);
}

/* TinyMCE container styling */
.tox-tinymce {
    border: 2px solid var(--medium-gray) !important;
    border-radius: 4px !important;
}

.tox.tox-tinymce.tox-tinymce--focus {
    border-color: var(--simcoe-blue) !important;
    box-shadow: 0 0 0 3px rgba(0, 119, 202, 0.1) !important;
}

/* Image upload containers */
.image-upload-container,
.image-url-container {
    background-color: var(--light-gray);
    padding: 16px;
    border-radius: 4px;
    margin-top: 8px;
}

/* File input styling */
input[type="file"] {
    width: 100%;
    padding: 8px;
    border: 2px dashed var(--simcoe-blue);
    border-radius: 4px;
    background-color: var(--white);
    cursor: pointer;
}

input[type="file"]:hover {
    background-color: var(--light-gray);
}

/* Contact fieldset styling */
.contact-fieldset {
    border: 2px solid var(--medium-gray);
    border-radius: 8px;
    padding: 24px;
    margin-top: 32px;
    margin-bottom: 24px;
    background-color: var(--light-gray);
}

.contact-legend {
    border: 2px solid var(--medium-gray);
    font-family: 'Ubuntu', Arial, sans-serif;
    font-weight: 500;
    color: var(--future-blue);
    font-size: 1.25rem;
    padding: 0 12px;
    background-color: var(--light-gray);
}

/* Footer text with Ubuntu font */
.cms-form > p {
    text-align: center;
    color: #666;
    font-size: 0.875rem;
    margin-top: 24px;
    font-family: 'Ubuntu', Arial, sans-serif;
}

/* Responsive design */
@media (max-width: 768px) {
    .header-container {
        padding: 0 20px;
    }
    
    .university-logo {
        height: 40px;
        margin: 0 auto;
    }
    
    .cms-form {
        padding: 20px;
        margin: 0 10px;
    }
    
    h1 {
        font-size: 1.75rem;
        margin: 20px 0;
    }
    
    .form-submit {
        width: 100%;
        padding: 16px;
    }
    
    .contact-fieldset {
        padding: 16px;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-input,
    .form-select,
    .form-textarea {
        border-width: 3px;
    }
    
    .form-submit {
        border: 2px solid currentColor;
    }
}

/* ===================================
   Enhanced Message Display Styles
   =================================== */

/* Message wrapper for consistent spacing */
.message-wrapper {
    max-width: 1000px;
    margin: 0 auto 30px;
    padding: 0 40px;
    animation: slideDown 0.4s ease-out;
}

/* Slide down animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Base message styling */
.success-msg,
.error-msg.general-error {
    position: relative;
    padding: 20px 60px 20px 65px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-height: 80px;
}

/* Message icons */
.message-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Success message specific styling */
.success-msg {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    border-left: 5px solid var(--success-green);
    color: var(--dark-gray);
}

.success-msg .message-icon::before {
    content: "✓";
    background: var(--success-green);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
}

/* Error message specific styling */
.error-msg.general-error {
    background: linear-gradient(135deg, #FFEBEE 0%, #FFCDD2 100%);
    border-left: 5px solid var(--error-red);
    color: var(--dark-gray);
}

.error-msg.general-error .message-icon::before {
    content: "!";
    background: var(--error-red);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
}

/* Message content */
.message-content {
    flex: 1;
    padding-right: 20px;
}

.message-content strong {
    display: block;
    margin-bottom: 5px;
    font-family: 'Ubuntu', Arial, sans-serif;
    font-size: 1.1rem;
}

.message-content p {
    margin: 0;
    line-height: 1.5;
}

/* Close button styling */
.message-close {
    position: absolute;
    right: 15px;
    top: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: rgba(0, 0, 0, 0.4);
    line-height: 1;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.message-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.message-close:focus {
    outline: 2px solid var(--simcoe-blue);
    outline-offset: 2px;
}

/* Field-level error improvements */
.form-group.has-error .form-input,
.form-group.has-error .form-select,
.form-group.has-error .form-textarea {
    border-color: var(--error-red);
    background-color: #FFF5F5;
}

.form-group.has-error .form-label {
    color: var(--error-red);
}

/* Inline field errors */
span.error-msg {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    color: var(--error-red);
    font-size: 0.875rem;
    font-style: normal;
}

span.error-msg::before {
    content: "⚠";
    font-size: 1rem;
}

/* Loading state for form submission */
.cms-form.submitting {
    opacity: 0.7;
    pointer-events: none;
}

.cms-form.submitting .form-submit {
    background-color: #999;
    cursor: not-allowed;
    position: relative;
    color: transparent;
}

.cms-form.submitting .form-submit::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.8s linear infinite;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .message-wrapper {
        padding: 0 20px;
        margin-bottom: 20px;
    }
    
    .success-msg,
    .error-msg.general-error {
        padding: 15px 45px 15px 55px;
        min-height: auto;
    }
    
    .message-icon {
        left: 15px;
        width: 28px;
        height: 28px;
    }
    
    .message-icon::before {
        width: 28px !important;
        height: 28px !important;
        font-size: 16px !important;
    }
    
    .message-close {
        right: 10px;
        top: 10px;
        width: 32px;
        height: 32px;
        font-size: 24px;
    }
    
    .message-content strong {
        font-size: 1rem;
    }
    
    .message-content p {
        font-size: 0.9rem;
    }
}

/* Print styles */
@media print {
    .message-close {
        display: none;
    }
    
    .success-msg,
    .error-msg.general-error {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .success-msg {
        background: var(--white);
        border: 3px solid var(--success-green);
    }
    
    .error-msg.general-error {
        background: var(--white);
        border: 3px solid var(--error-red);
    }
    
    .message-close {
        border: 2px solid currentColor;
    }
}