/* ============================================
   ShipQA Common Stylesheet
   Shared styles across all HTML pages
   ============================================ */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    --primary-navy: #2E5C7F;
    --accent-orange: #F57C35;
    --success-green: #4CAF50;
    --bg-white: #FFFFFF;
    --bg-light: #F8F9FA;
    --text-dark: #333333;
    --text-light: #666666;
    --border-light: #E5E7EB;
}

/* ============================================
   GLOBAL RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-light);
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

/* ============================================
   HEADER COMPONENT
   ============================================ */
.header {
    background: var(--bg-white);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ============================================
   LOGO COMPONENT
   ============================================ */
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-navy);
    text-decoration: none;
}

.logo-icon {
    width: 187px;
    height: 50px;
    background: url('/static/ShipQA.png') no-repeat center;
    background-size: contain;
}

/* ============================================
   USER INFO COMPONENT
   ============================================ */
.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

/* ============================================
   BUTTON COMPONENTS
   ============================================ */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--accent-orange);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-right: 8px;
}

.btn:hover {
    background: #e56b2a;
    transform: translateY(-2px);
}

.btn-success { background: var(--success-green); }
.btn-success:hover { background: #3d8b40; }
.btn-danger { background: #dc3545; }
.btn-danger:hover { background: #c82333; }
.btn-secondary { background: #6c757d; }
.btn-secondary:hover { background: #5a6268; }
.btn-warning { background: #ffc107; color: #212529; }
.btn-warning:hover { background: #e0a800; }
.btn-small { padding: 0.5rem 1rem; font-size: 0.875rem; }

/* ============================================
   BREADCRUMB NAVIGATION
   ============================================ */
.breadcrumb {
    margin-bottom: 20px;
    font-size: 14px;
}

.breadcrumb a {
    color: var(--accent-orange);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* ============================================
   MODAL COMPONENT
   ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--bg-white);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 12px;
    width: 500px;
    max-width: 90%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.modal-content.large-modal {
    width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    color: var(--primary-navy);
    font-weight: 600;
}

.close {
    color: var(--text-light);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--text-dark);
}

/* ============================================
   FORM COMPONENTS
   ============================================ */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-orange);
}

.form-group textarea {
    height: 80px;
    resize: vertical;
}

.form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

/* ============================================
   EMPTY STATE COMPONENT
   ============================================ */
.empty-state {
    text-align: center;
    color: var(--text-light);
    padding: 40px;
    background: var(--bg-white);
    border-radius: 12px;
    border: 2px dashed var(--border-light);
}

/* ============================================
   SECTION STYLES
   ============================================ */
.section-title {
    margin: 0 0 16px 0;
    color: var(--primary-navy);
    border-bottom: 2px solid var(--accent-orange);
    padding-bottom: 8px;
    font-weight: 600;
}

.content-section {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* ============================================
   TAG COMPONENT
   ============================================ */
.tag {
    display: inline-block;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1976d2;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 4px;
    margin-bottom: 4px;
}

/* ============================================
   DRAG & DROP STYLES
   ============================================ */
.drag-handle {
    cursor: grab;
    padding-right: 8px;
    color: var(--text-light);
}

.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.drag-over {
    border-top: 3px solid var(--accent-orange);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.loading-state {
    text-align: center;
    color: var(--text-light);
    padding: 20px;
}

.error-state {
    text-align: center;
    padding: 40px;
    color: #dc3545;
}

/* ============================================
   NAV DROPDOWN
   ============================================ */
.nav-dropdown {
    position: relative;
}

.nav-dropdown > .nav-link {
    cursor: pointer;
}

.nav-dropdown > .nav-link::after {
    content: ' \25BE';
    font-size: 0.7em;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 0.5rem 0;
    min-width: 200px;
    z-index: 1001;
    list-style: none;
}

.nav-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 0.6rem 1.2rem;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s ease;
}

.dropdown-menu a:hover {
    background: var(--bg-light);
    color: var(--accent-orange);
}

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