/**
 * Admin Styles for Simple Password Protect Plugin
 * 
 * @package SimplePasswordProtect
 */

/* Status info box */
.spp-status-info {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-left: 4px solid #72aee6;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
    padding: 12px;
    margin: 20px 0;
    border-radius: 0 3px 3px 0;
}

.spp-status-info h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
    color: #1d2327;
}

.spp-status-info p {
    margin: 8px 0;
    color: #50575e;
}

.spp-status-info .status-enabled {
    color: #00a32a;
    font-weight: 600;
}

.spp-status-info .status-disabled {
    color: #d63638;
    font-weight: 600;
}

.spp-status-info .status-warning {
    color: #dba617;
    font-weight: 600;
}

/* Test section */
.spp-test-section {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.spp-test-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #1d2327;
}

.spp-test-section p {
    color: #50575e;
    margin-bottom: 15px;
}

/* Logo upload section */
.spp-logo-preview-container {
    margin-top: 15px;
}

.spp-logo-preview {
    max-width: 200px;
    max-height: 100px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 8px;
    background: #f6f7f7;
    display: block;
    transition: all 0.3s ease;
}

/* Logo shape variants */
.spp-logo-preview.square {
    border-radius: 4px;
}

.spp-logo-preview.round {
    border-radius: 50%;
    width: 100px;
    height: 100px;
    max-width: 100px;
    max-height: 100px;
    object-fit: cover;
}

.spp-upload-logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.spp-upload-logo-container input[type="url"] {
    flex: 1;
    min-width: 200px;
}

/* Settings sections styling */
.form-table th {
    width: 200px;
    font-weight: 600;
}

.form-table td p.description {
    margin-top: 8px;
    margin-bottom: 0;
    color: #646970;
    font-style: italic;
}

/* Password field styling */
.spp-password-field-container {
    position: relative;
    display: inline-block;
}

.spp-password-field-container input[type="password"] {
    padding-right: 40px;
}

.spp-password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #646970;
    font-size: 16px;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spp-password-toggle:hover {
    color: #2271b1;
}

/* Settings validation */
.spp-field-error {
    border-color: #d63638 !important;
    box-shadow: 0 0 0 1px #d63638 !important;
}

.spp-error-message {
    color: #d63638;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

.spp-success-message {
    color: #00a32a;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* Notice styling enhancements */
.notice.spp-notice {
    border-left-width: 4px;
    border-left-style: solid;
    margin: 15px 0;
    padding: 12px;
}

.notice.spp-notice.notice-warning {
    border-left-color: #dba617;
    background-color: #fcf9e8;
}

.notice.spp-notice.notice-error {
    border-left-color: #d63638;
    background-color: #fcf0f1;
}

.notice.spp-notice.notice-success {
    border-left-color: #00a32a;
    background-color: #edfaef;
}

.notice.spp-notice.notice-info {
    border-left-color: #72aee6;
    background-color: #f0f6fc;
}

/* Responsive adjustments */
@media screen and (max-width: 782px) {
    .spp-upload-logo-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .spp-upload-logo-container input[type="url"] {
        min-width: auto;
        margin-bottom: 10px;
    }
    
    .form-table th {
        width: auto;
        padding-bottom: 0;
    }
    
    .form-table td {
        padding-top: 5px;
    }
}

/* Custom checkbox styling */
.spp-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spp-checkbox-wrapper input[type="checkbox"] {
    margin: 0;
}

.spp-checkbox-wrapper label {
    margin: 0;
    font-weight: normal;
}

/* Enhanced textarea styling */
.spp-textarea {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    resize: vertical;
    min-height: 80px;
}

/* Select dropdown enhancements */
.spp-select {
    min-width: 200px;
}

.spp-select option {
    padding: 8px;
}

/* Button enhancements */
.button.spp-button-secondary {
    background: #f6f7f7;
    border-color: #c3c4c7;
    color: #50575e;
}

.button.spp-button-secondary:hover {
    background: #f0f0f1;
    border-color: #8c8f94;
    color: #1d2327;
}

/* Loading states */
.spp-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f4f5;
    border-top: 2px solid #3582c4;
    border-radius: 50%;
    animation: spp-spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

/* Settings page header */
.spp-settings-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #c3c4c7;
}

.spp-settings-header .dashicons {
    font-size: 32px;
    color: #72aee6;
}

.spp-settings-header h1 {
    margin: 0;
    color: #1d2327;
}

/* Tips and hints */
.spp-tip {
    background: #f0f6fc;
    border: 1px solid #c3c4c7;
    border-left: 4px solid #72aee6;
    padding: 12px;
    margin: 15px 0;
    border-radius: 0 4px 4px 0;
}

.spp-tip .dashicons {
    color: #72aee6;
    margin-right: 8px;
    vertical-align: middle;
}

.spp-tip p {
    margin: 0;
    color: #1d2327;
}

/* Settings tabs (if needed in future) */
.spp-tabs {
    margin: 20px 0;
    border-bottom: 1px solid #c3c4c7;
}

.spp-tabs ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
}

.spp-tabs li {
    margin: 0;
    padding: 0;
}

.spp-tabs a {
    display: block;
    padding: 12px 15px;
    text-decoration: none;
    color: #646970;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.spp-tabs a:hover {
    color: #1d2327;
}

.spp-tabs .active a {
    color: #1d2327;
    border-bottom-color: #72aee6;
    font-weight: 600;
}

/* Print styles */
@media print {
    .spp-test-section,
    .spp-upload-logo-container button,
    .submit {
        display: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .spp-status-info {
        border-color: #000;
        border-left-color: #0073aa;
    }
    
    .spp-test-section {
        border-color: #000;
    }
    
    .spp-logo-preview {
        border-color: #000;
    }
}

/* Accessibility improvements */
.spp-screen-reader-text {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    word-wrap: normal !important;
    overflow: hidden;
    width: 1px;
    height: 1px;
}

/* Focus styles */
.spp-upload-logo-container button:focus,
.spp-password-toggle:focus,
input[type="checkbox"]:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
    outline: 2px solid #005cee;
    outline-offset: 1px;
}

/* Animation for smooth transitions */
.form-table tr {
    transition: background-color 0.2s ease;
}

.form-table tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
} 