/* CSS for Simple Site Audit Plugin - Frontend Styles */

/* Container for the form wrapper */
.ssa-form-wrap {
    max-width: 800px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Container for each audit section */
.ssa-audit-section {
    background-color: #f9f9f9;
    border: 1px solid #e1e1e1;
    padding: 25px;
    margin-bottom: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Title of each audit section */
.ssa-audit-title {
    font-size: 28px;
    margin-bottom: 20px;
    color: #1d2327;
    font-weight: 600;
    border-bottom: 3px solid #2271b1;
    padding-bottom: 10px;
}

/* Progress bar container */
.ssa-progress-bar {
    background-color: #e1e1e1;
    border-radius: 25px;
    overflow: hidden;
    height: 24px;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

/* Progress bar fill */
.ssa-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #1abc9c 0%, #16a085 100%);
    width: 0%;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 25px;
    position: relative;
}

/* Progress bar shine effect */
.ssa-progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255,255,255,0.4) 50%, 
        transparent 100%);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Success, warning, and error messages */
.ssa-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 500;
    border-left: 5px solid;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ssa-message-success {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
    border-left-color: #27ae60;
    color: #1e6e3e;
}

.ssa-message-warning {
    background: linear-gradient(135deg, #fff8e1 0%, #fffbee 100%);
    border-left-color: #f39c12;
    color: #b7701a;
}

.ssa-message-error {
    background: linear-gradient(135deg, #fdeaea 0%, #fef2f2 100%);
    border-left-color: #e74c3c;
    color: #c53030;
}

.ssa-message-notice {
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f8ff 100%);
    border-left-color: #2196f3;
    color: #1565c0;
}

/* Heading structure list */
.ssa-heading-structure {
    list-style-type: none;
    padding-left: 0;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.ssa-heading-structure > li {
    margin-bottom: 8px;
    line-height: 1.6;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.ssa-heading-structure > li:hover {
    background: rgba(0,0,0,0.02);
}

/* Indentation using padding */
.ssa-heading-structure > li.level-1 { padding-left: 15px; }
.ssa-heading-structure > li.level-2 { padding-left: 35px; }
.ssa-heading-structure > li.level-3 { padding-left: 55px; }
.ssa-heading-structure > li.level-4 { padding-left: 75px; }
.ssa-heading-structure > li.level-5 { padding-left: 95px; }
.ssa-heading-structure > li.level-6 { padding-left: 115px; }

/* Color coding for heading correctness */
.ssa-heading-correct {
    color: #27ae60;
    font-weight: 500;
}

.ssa-heading-incorrect {
    color: #e74c3c;
    font-weight: 500;
}

/* General text styling */
.ssa-audit-section p,
.ssa-audit-section ul {
    font-size: 16px;
    line-height: 1.6;
    color: #4a5568;
}

.ssa-audit-section strong {
    color: #1d2327;
    font-weight: 600;
}

/* Form styling */
.ssa-form {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 30px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.ssa-form-group {
    margin-bottom: 20px;
}

.ssa-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1d2327;
    font-size: 15px;
}

.ssa-form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    background: white;
}

.ssa-form-control:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
    transform: translateY(-1px);
}

.ssa-button {
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    color: #fff;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

.ssa-button:hover {
    background: linear-gradient(135deg, #135e96 0%, #0f4a78 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(34, 113, 177, 0.4);
}

.ssa-button:active {
    transform: translateY(0);
}

.ssa-button:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Results container */
.ssa-audit-results {
    margin-top: 30px;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Overall score section styling */
.ssa-audit-results .ssa-audit-section:first-child {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.ssa-audit-results .ssa-audit-section:first-child .ssa-audit-title {
    color: white;
    border-bottom-color: rgba(255,255,255,0.3);
}

.ssa-audit-results .ssa-audit-section:first-child .ssa-progress-bar {
    background: rgba(255,255,255,0.2);
}

.ssa-audit-results .ssa-audit-section:first-child strong {
    color: white;
}

/* Individual audit sections */
.ssa-audit-results .ssa-audit-section:not(:first-child) {
    border-left: 5px solid #2271b1;
}

/* Status message styling */
.ssa-message {
    position: relative;
}

.ssa-message::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 0;
    bottom: 0;
    width: 5px;
    border-radius: 0 4px 4px 0;
}

.ssa-message-success::before { background: #27ae60; }
.ssa-message-warning::before { background: #f39c12; }
.ssa-message-error::before { background: #e74c3c; }
.ssa-message-notice::before { background: #2196f3; }

/* Loading states */
.ssa-loading {
    position: relative;
    pointer-events: none;
}

.ssa-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ssa-form-wrap {
        margin: 10px;
        max-width: none;
    }
    
    .ssa-audit-title {
        font-size: 24px;
    }

    .ssa-form {
        padding: 20px;
    }

    .ssa-form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .ssa-button {
        width: 100%;
        padding: 16px;
        font-size: 18px;
    }
    
    .ssa-audit-section {
        padding: 20px;
    }

    .ssa-progress-bar {
        height: 20px;
    }
}

@media (max-width: 480px) {
    .ssa-audit-section {
        padding: 15px;
    }
    
    .ssa-audit-title {
        font-size: 20px;
    }
    
    .ssa-form {
        padding: 15px;
    }
}
