/**
 * Prayer Warriors Plugin Styles
 * CSS for the Prayer Warriors WordPress plugin frontend
 */

/* Prayer Warriors App Container */
#prayer-warriors-app {
    max-width: 800px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
}

/* Messages */
.prayer-message {
    position: relative;
    padding: 15px 40px 15px 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

.prayer-message-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.prayer-message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.prayer-message-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.prayer-message-close:hover {
    opacity: 1;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Prayer Requests Section */
#prayer-requests-container {
    margin-bottom: 40px;
}

#prayer-requests-container h3 {
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

#prayer-requests-list {
    display: grid;
    gap: 20px;
}

.prayer-request-item {
    background: #ffffff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.prayer-request-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.prayer-request-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.prayer-topic {
    margin: 0;
    color: #0073aa;
    font-size: 1.2em;
    font-weight: 600;
    flex: 1;
    min-width: 200px;
}

.prayer-stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.prayer-count,
.active-count {
    background: #f0f6fc;
    color: #0969da;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
    white-space: nowrap;
}

.active-count {
    background: #fff5f5;
    color: #d73a49;
}

.prayer-description {
    margin-bottom: 15px;
}

.prayer-description p {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 4px;
    margin: 0;
    font-style: italic;
    color: #495057;
}

.prayer-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.85em;
    color: #6c757d;
    flex-wrap: wrap;
    gap: 10px;
}

.prayer-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #0073aa;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #005a87;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #545b62;
    transform: translateY(-1px);
}

/* No Requests State */
.no-requests {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #6c757d;
}

.no-requests p {
    margin: 0;
    font-size: 1.1em;
}

/* Prayer Form Section */
#prayer-form-container {
    background: #ffffff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#prayer-form-container h3 {
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
    margin-bottom: 20px;
    margin-top: 0;
}

#prayer-request-form .form-group {
    margin-bottom: 20px;
}

#prayer-request-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

#prayer-request-form select,
#prayer-request-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

#prayer-request-form select:focus,
#prayer-request-form textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

#prayer-request-form textarea {
    resize: vertical;
    min-height: 100px;
    max-height: 200px;
}

#prayer-request-form button[type="submit"] {
    background: #0073aa;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease;
}

#prayer-request-form button[type="submit"]:hover:not(:disabled) {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.3);
}

#prayer-request-form button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    #prayer-warriors-app {
        margin: 10px;
    }
    
    .prayer-request-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .prayer-stats {
        align-self: stretch;
        justify-content: space-between;
    }
    
    .prayer-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .prayer-actions {
        justify-content: stretch;
    }
    
    .prayer-actions .btn {
        flex: 1;
        text-align: center;
    }
    
    #prayer-form-container,
    .prayer-request-item {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .prayer-actions {
        flex-direction: column;
    }
    
    .prayer-stats {
        flex-direction: column;
        gap: 8px;
    }
    
    .prayer-count,
    .active-count {
        text-align: center;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    #prayer-warriors-app {
        color: #e1e1e1;
    }
    
    .prayer-request-item,
    #prayer-form-container {
        background: #1a1a1a;
        border-color: #333;
        color: #e1e1e1;
    }
    
    .prayer-topic {
        color: #58a6ff;
    }
    
    .prayer-description p {
        background: #262626;
        color: #b3b3b3;
    }
    
    .no-requests {
        background: #262626;
        color: #b3b3b3;
    }
    
    #prayer-request-form select,
    #prayer-request-form textarea {
        background: #262626;
        border-color: #404040;
        color: #e1e1e1;
    }
    
    #prayer-request-form select:focus,
    #prayer-request-form textarea:focus {
        border-color: #58a6ff;
        box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
    }
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.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 #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility improvements */
.btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.prayer-message:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .prayer-actions,
    #prayer-form-container,
    .prayer-message {
        display: none;
    }
    
    .prayer-request-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
