/**
 * SpesTheme Component Styles
 * 
 * Component-based CSS for SpesTheme functionality
 * 
 * @package SpesTheme
 * @version 1.0.0
 */

/* ==========================================================================
   Feide Integration Components
   ========================================================================== */

.spes-feide-notice {
    background-color: var(--spes-accent-color);
    border-left: 4px solid var(--spes-primary-color);
    padding: 15px 20px;
    margin-bottom: 25px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.3s ease;
    position: relative;
}

.spes-feide-notice:hover {
    background-color: var(--spes-secondary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.2);
}

.spes-feide-notice::before {
    content: "ℹ";
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--spes-primary-color);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* ==========================================================================
   Prefilled Field Components
   ========================================================================== */

.spes-prefilled-field {
    position: relative;
}

.spes-prefilled-field::before {
    content: "✓";
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--spes-primary-color);
    font-weight: bold;
    font-size: 14px;
    z-index: 1;
}

.spes-prefilled-field input,
.spes-prefilled-field textarea,
.spes-prefilled-field select {
    background-color: rgba(240, 248, 255, 0.3);
    border-left: 3px solid var(--spes-primary-color);
    transition: all 0.3s ease;
    position: relative;
}

.spes-prefilled-field input:focus,
.spes-prefilled-field textarea:focus,
.spes-prefilled-field select:focus {
    border-color: var(--spes-secondary-color);
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
    background-color: rgba(240, 248, 255, 0.5);
    outline: none;
}

.spes-prefilled-field input:hover,
.spes-prefilled-field textarea:hover,
.spes-prefilled-field select:hover {
    background-color: rgba(240, 248, 255, 0.4);
    border-left-color: var(--spes-secondary-color);
}

/* ==========================================================================
   Gravity Forms Integration
   ========================================================================== */

.spes-gf-field {
    margin-bottom: 20px;
}

.spes-gf-field input,
.spes-gf-field textarea,
.spes-gf-field select {
    border-radius: 4px;
    border: 1px solid var(--spes-border-color);
    padding: 10px 12px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.spes-gf-field input:focus,
.spes-gf-field textarea:focus,
.spes-gf-field select:focus {
    border-color: var(--spes-primary-color);
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
    outline: none;
}

.spes-gf-prefilled {
    background-color: rgba(240, 248, 255, 0.1);
}

/* ==========================================================================
   User Information Components
   ========================================================================== */

.spes-user-info {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 25px;
    margin: 20px 0;
    border-left: 4px solid var(--spes-primary-color);
}

.spes-user-info h3 {
    margin-top: 0;
    color: var(--spes-primary-color);
    font-size: 18px;
    font-weight: 600;
}

.spes-user-info p {
    margin: 8px 0;
    line-height: 1.6;
}

.spes-user-info strong {
    color: var(--spes-text-color);
    font-weight: 600;
}

/* ==========================================================================
   Feide Status Components
   ========================================================================== */

.spes-feide-status {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 25px;
    margin: 20px 0;
    border-left: 4px solid var(--spes-primary-color);
}

.spes-feide-status h3 {
    margin-top: 0;
    color: var(--spes-primary-color);
    font-size: 18px;
    font-weight: 600;
}

.spes-status-success {
    color: #28a745;
    font-weight: 600;
    background-color: #d4edda;
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 3px solid #28a745;
}

.spes-status-error {
    color: #dc3545;
    font-weight: 600;
    background-color: #f8d7da;
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 3px solid #dc3545;
}

/* ==========================================================================
   Alert Components
   ========================================================================== */

.spes-alert {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid;
    position: relative;
    font-size: 14px;
    line-height: 1.5;
}

.spes-alert-info {
    background-color: var(--spes-accent-color);
    border-left-color: var(--spes-primary-color);
    color: var(--spes-secondary-color);
}

.spes-alert-success {
    background-color: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

.spes-alert-warning {
    background-color: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

.spes-alert-error {
    background-color: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

/* ==========================================================================
   Card Components
   ========================================================================== */

.spes-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 25px;
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--spes-border-color);
}

.spes-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.spes-card h3 {
    margin-top: 0;
    color: var(--spes-primary-color);
    font-size: 18px;
    font-weight: 600;
}

.spes-card p {
    margin: 10px 0;
    line-height: 1.6;
    color: var(--spes-text-color);
}

/* ==========================================================================
   Button Components
   ========================================================================== */

.spes-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--spes-primary-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.spes-button:hover {
    background-color: var(--spes-secondary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.3);
    color: white;
    text-decoration: none;
}

.spes-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.3);
}

.spes-button-secondary {
    background-color: transparent;
    color: var(--spes-primary-color);
    border: 2px solid var(--spes-primary-color);
}

.spes-button-secondary:hover {
    background-color: var(--spes-primary-color);
    color: white;
}

/* ==========================================================================
   Skip Link Components
   ========================================================================== */

.spes-skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--spes-primary-color);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
    transition: top 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.spes-skip-link:focus {
    top: 6px;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.3);
}

/* ==========================================================================
   Footer Components
   ========================================================================== */

.spes-footer-credits {
    background-color: var(--spes-light-gray);
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid var(--spes-border-color);
    font-size: 14px;
    color: var(--spes-text-color);
}

.spes-footer-credits p {
    margin: 0;
}

.spes-footer-credits a {
    color: var(--spes-primary-color);
    text-decoration: none;
}

.spes-footer-credits a:hover {
    color: var(--spes-secondary-color);
    text-decoration: underline;
}

/* ==========================================================================
   Admin Components
   ========================================================================== */

.spes-admin-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.spes-admin-content h2 {
    color: var(--spes-primary-color);
    border-bottom: 2px solid var(--spes-accent-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.spes-admin-content table {
    width: 100%;
    border-collapse: collapse;
}

.spes-admin-content th,
.spes-admin-content td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--spes-border-color);
}

.spes-admin-content th {
    background-color: var(--spes-accent-color);
    font-weight: 600;
    color: var(--spes-primary-color);
}

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

@media (max-width: 768px) {
    .spes-feide-notice {
        padding: 12px 15px;
        font-size: 13px;
        margin-bottom: 20px;
    }
    
    .spes-feide-notice::before {
        left: -8px;
        width: 16px;
        height: 16px;
        font-size: 10px;
    }
    
    .spes-prefilled-field::before {
        left: -15px;
        font-size: 12px;
    }
    
    .spes-user-info,
    .spes-feide-status,
    .spes-card {
        padding: 20px;
        margin: 15px 0;
    }
    
    .spes-button {
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }
    
    .spes-skip-link {
        left: 4px;
        padding: 6px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .spes-feide-notice {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .spes-prefilled-field input,
    .spes-prefilled-field textarea,
    .spes-prefilled-field select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .spes-user-info,
    .spes-feide-status,
    .spes-card {
        padding: 15px;
    }
    
    .spes-admin-content {
        padding: 15px;
    }
}

/* ==========================================================================
   Accessibility Improvements
   ========================================================================== */

/* High contrast mode support */
@media (prefers-contrast: high) {
    .spes-feide-notice {
        border-width: 3px;
        background-color: white;
        color: black;
    }
    
    .spes-prefilled-field input,
    .spes-prefilled-field textarea,
    .spes-prefilled-field select {
        border-width: 2px;
        background-color: white;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .spes-prefilled-field input,
    .spes-prefilled-field textarea,
    .spes-prefilled-field select,
    .spes-feide-notice,
    .spes-card,
    .spes-button {
        transition: none;
    }
    
    .spes-feide-notice:hover,
    .spes-card:hover,
    .spes-button:hover {
        transform: none;
    }
}

/* Focus indicators for keyboard navigation */
.spes-prefilled-field input:focus,
.spes-prefilled-field textarea:focus,
.spes-prefilled-field select:focus,
.spes-button:focus,
.spes-skip-link:focus {
    outline: 2px solid var(--spes-primary-color);
    outline-offset: 2px;
}

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

@media print {
    .spes-feide-notice,
    .spes-prefilled-field::before,
    .spes-skip-link {
        display: none;
    }
    
    .spes-user-info,
    .spes-feide-status,
    .spes-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .spes-button {
        background-color: transparent;
        color: black;
        border: 1px solid black;
    }
} 