/*
    Dissertation Theme Stylesheet
    Created: 2025-12-08
    Description: Harmonizes the database application styling with the main dissertation
    Overrides W3.CSS defaults to match the dissertation's visual design
*/

/* ========================================
   Color Scheme Override - Match Dissertation
   ======================================== */

:root {
    /* Override primary colors to match dissertation */
    --primary-color: #2c3e50;        /* Dark blue-gray (dissertation sidebar) */
    --primary-dark: #1a252f;         /* Darker shade for depth */
    --primary-light: #34495e;        /* Lighter shade for hover */

    /* Accent color for interactive elements */
    --accent-color: #3498db;         /* Professional blue for links/buttons */
    --accent-dark: #2980b9;          /* Darker blue for hover */

    /* Update text colors */
    --text-color: #333333;
    --text-light: #666666;
    --text-inverse: #ffffff;

    /* Background colors */
    --background-color: #f8f9fa;     /* Match dissertation background */
    --background-white: #ffffff;

    /* Border colors */
    --border-color: #ddd;
    --border-color-light: #e8e8e8;
}

/* ========================================
   Typography - Match Dissertation Fonts
   ======================================== */

body {
    font-family: 'Lato', 'Roboto', sans-serif;
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Merriweather', 'Georgia', serif;
    color: var(--primary-color);
    font-weight: 600;
}

/* ========================================
   Header Styling - Match Dissertation
   ======================================== */

header.w3-container.w3-teal,
.w3-teal {
    background-color: var(--primary-color) !important;
    color: var(--text-inverse) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-family: 'Merriweather', serif;
    font-size: 1.75rem;
    color: var(--text-inverse);
    margin: 0;
    padding: 20px 0;
}

/* ========================================
   Navigation Bar - Match Dissertation Style
   ======================================== */

.w3-bar-block {
    background-color: var(--primary-light) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.w3-bar-block a.w3-bar-item,
.w3-bar-item.w3-button {
    background-color: transparent !important;
    color: var(--text-inverse) !important;
    border: none;
    padding: 12px 20px !important;
    text-align: left;
    font-family: 'Lato', sans-serif;
    transition: background-color 0.3s, padding-left 0.3s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.w3-bar-block a.w3-bar-item:hover,
.w3-bar-item.w3-button:hover {
    background-color: var(--primary-dark) !important;
    padding-left: 25px !important;
}

/* Back to Dissertation Link */
.back-to-dissertation {
    background-color: var(--accent-color) !important;
    color: white !important;
    margin: 0 !important;
    border-top: 2px solid rgba(255, 255, 255, 0.2) !important;
}

.back-to-dissertation:hover {
    background-color: var(--accent-dark) !important;
}

/* ========================================
   Container & Layout
   ======================================== */

.w3-container {
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 16px;
    padding-right: 16px;
}

.main-content {
    background-color: var(--background-white);
    padding: 30px;
    margin: 30px 0;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ========================================
   Tables - Match Dissertation Style
   ======================================== */

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background-color: var(--background-white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

table thead tr {
    background-color: var(--primary-color) !important;
    color: var(--text-inverse);
}

table th {
    background-color: var(--primary-color) !important;
    color: var(--text-inverse) !important;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-family: 'Lato', sans-serif;
    border: none;
}

table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color-light);
    color: var(--text-color);
}

table tbody tr:hover {
    background-color: #f5f8fa;
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* Striped rows */
table tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

/* ========================================
   Links & Buttons
   ======================================== */

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

/* Table cell buttons */
table td a.w3-bar-item.w3-button {
    background-color: transparent !important;
    color: var(--accent-color) !important;
    padding: 4px 8px !important;
    border: none;
    font-weight: 500;
}

table td a.w3-bar-item.w3-button:hover {
    background-color: rgba(52, 152, 219, 0.1) !important;
    color: var(--accent-dark) !important;
    padding-left: 8px !important;
}

/* ========================================
   Forms & Inputs
   ======================================== */

input[type="text"],
input[type="search"],
select {
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'Lato', sans-serif;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="text"]:focus,
input[type="search"]:focus,
select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    outline: none;
}

button,
input[type="submit"] {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Lato', sans-serif;
    font-weight: 500;
    transition: background-color 0.3s, transform 0.1s;
}

button:hover,
input[type="submit"]:hover {
    background-color: var(--accent-dark);
    transform: translateY(-1px);
}

/* ========================================
   Tooltips
   ======================================== */

.tooltip {
    position: relative;
    display: inline-block;
    border-bottom: 1px dotted var(--accent-color);
    cursor: help;
}

.tooltip .tooltiptext {
    visibility: hidden;
    background-color: var(--primary-color);
    color: var(--text-inverse);
    text-align: center;
    padding: 8px 12px;
    border-radius: 4px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap;
    font-size: 0.875rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--primary-color) transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* ========================================
   Error & Info Messages
   ======================================== */

.w3-panel.w3-red {
    background-color: #f8d7da !important;
    color: #721c24 !important;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 12px 16px;
}

.w3-panel.w3-green {
    background-color: #d4edda !important;
    color: #155724 !important;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 12px 16px;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
        padding: 15px 0;
    }

    .main-content {
        padding: 20px;
        margin: 20px 0;
    }

    table {
        font-size: 0.9rem;
    }

    table th,
    table td {
        padding: 8px 12px;
    }

    .w3-bar-block a.w3-bar-item,
    .w3-bar-item.w3-button {
        padding: 10px 16px !important;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.25rem;
    }

    .main-content {
        padding: 15px;
        margin: 15px 0;
    }

    table {
        font-size: 0.85rem;
    }

    /* Make tables horizontally scrollable on small screens */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .w3-bar-block,
    .back-to-dissertation {
        display: none;
    }

    header {
        background-color: white !important;
        color: black !important;
        border-bottom: 2px solid black;
    }

    header h1 {
        color: black !important;
    }

    table th {
        background-color: #e0e0e0 !important;
        color: black !important;
    }
}
