/**
 * Software Manager - Scoped CSS Reset
 * Prevents external theme/plugin interference without affecting global styles
 */

.sm-plugin-wrapper {
    /* CSS Custom Properties for consistent theming */
    --sm-primary-color: #1A172C;
    --sm-secondary-color: #64748b;
    --sm-accent-color: #f1f5f9;
    --sm-border-color: #e0e6ed;
    --sm-text-color: #2c3338;
    --sm-link-color: #2271b1;
    --sm-success-color: #4caf50;
    --sm-warning-color: #ff6f00;
    --sm-error-color: #d32f2f;
    --sm-rating-color: #ffc107;
    
    /* Reset and normalize only plugin content */
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--sm-text-color);
    
    /* Isolate from external styles */
    all: initial;
    font-size: 14px;
    
    /* Re-enable inheritance for children */
    * {
        box-sizing: inherit;
    }
}

/* Reset common elements within plugin wrapper */
.sm-plugin-wrapper h1,
.sm-plugin-wrapper h2,
.sm-plugin-wrapper h3,
.sm-plugin-wrapper h4,
.sm-plugin-wrapper h5,
.sm-plugin-wrapper h6 {
    margin: 0 0 1rem 0;
    font-weight: 600;
    line-height: 1.3;
    color: var(--sm-text-color);
}

.sm-plugin-wrapper p {
    margin: 0 0 1rem 0;
    line-height: 1.6;
}

.sm-plugin-wrapper a {
    color: var(--sm-link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.sm-plugin-wrapper a:hover {
    color: var(--sm-primary-color);
}

.sm-plugin-wrapper ul,
.sm-plugin-wrapper ol {
    margin: 0 0 1rem 0;
    padding-left: 2rem;
}

.sm-plugin-wrapper li {
    margin-bottom: 0.5rem;
}

.sm-plugin-wrapper img {
    max-width: 100%;
    height: auto;
    border: 0;
}

.sm-plugin-wrapper table {
    border-collapse: collapse;
    width: 100%;
    margin: 0 0 1rem 0;
}

.sm-plugin-wrapper th,
.sm-plugin-wrapper td {
    padding: 8px 12px;
    text-align: left;
    border: 1px solid var(--sm-border-color);
}

.sm-plugin-wrapper th {
    background-color: var(--sm-accent-color);
    font-weight: 600;
}

.sm-plugin-wrapper input,
.sm-plugin-wrapper select,
.sm-plugin-wrapper textarea,
.sm-plugin-wrapper button {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid var(--sm-border-color);
    border-radius: 4px;
    background-color: #fff;
    color: var(--sm-text-color);
}

.sm-plugin-wrapper button {
    cursor: pointer;
    background-color: var(--sm-primary-color);
    color: #fff;
    border-color: var(--sm-primary-color);
    transition: all 0.2s ease;
}

.sm-plugin-wrapper button:hover {
    background-color: var(--sm-secondary-color);
    border-color: var(--sm-secondary-color);
}

.sm-plugin-wrapper button:focus,
.sm-plugin-wrapper input:focus,
.sm-plugin-wrapper select:focus,
.sm-plugin-wrapper textarea:focus {
    outline: 2px solid var(--sm-link-color);
    outline-offset: 1px;
}

/* Utility classes for common patterns */
.sm-plugin-wrapper .sm-screen-reader-text {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    word-wrap: normal !important;
    border: 0;
    padding: 0;
    margin: 0;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

.sm-plugin-wrapper .sm-clearfix::after {
    content: "";
    display: table;
    clear: both;
}

.sm-plugin-wrapper .sm-text-center {
    text-align: center;
}

.sm-plugin-wrapper .sm-text-left {
    text-align: left;
}

.sm-plugin-wrapper .sm-text-right {
    text-align: right;
}

.sm-plugin-wrapper .sm-mb-0 { margin-bottom: 0; }
.sm-plugin-wrapper .sm-mb-1 { margin-bottom: 0.5rem; }
.sm-plugin-wrapper .sm-mb-2 { margin-bottom: 1rem; }
.sm-plugin-wrapper .sm-mb-3 { margin-bottom: 1.5rem; }
.sm-plugin-wrapper .sm-mb-4 { margin-bottom: 2rem; }

.sm-plugin-wrapper .sm-mt-0 { margin-top: 0; }
.sm-plugin-wrapper .sm-mt-1 { margin-top: 0.5rem; }
.sm-plugin-wrapper .sm-mt-2 { margin-top: 1rem; }
.sm-plugin-wrapper .sm-mt-3 { margin-top: 1.5rem; }
.sm-plugin-wrapper .sm-mt-4 { margin-top: 2rem; }

/* Responsive utilities */
@media screen and (max-width: 768px) {
    .sm-plugin-wrapper {
        font-size: 13px;
    }
    
    .sm-plugin-wrapper .sm-mobile-hidden {
        display: none;
    }
}

@media screen and (min-width: 769px) {
    .sm-plugin-wrapper .sm-desktop-hidden {
        display: none;
    }
}