/* --- Fully Scoped Plugin CSS with Button Spacing --- */
.ngc-wrapper * {
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Wrapper & body */
.ngc-wrapper {
    background-color: #fff;
    color: #333;
    padding: auto;
    line-height: 1.6;
    overflow-x: hidden; /* fix mobile overflow */
}

/* Container inside plugin only */
.ngc-wrapper .container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.ngc-wrapper header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e1e5eb;
}

.ngc-wrapper h1 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.ngc-wrapper .subtitle {
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* Grade system selector */
.ngc-wrapper .grade-system-selector {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    text-align: center;
}

.ngc-wrapper .grade-system-selector label {
    font-weight: 600;
    margin-right: 10px;
}

.ngc-wrapper .grade-system-selector select {
    padding: 8px 15px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    font-size: 16px;
    width: 200px;
}

/* Classes container */
.ngc-wrapper .classes-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.ngc-wrapper .class-card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.ngc-wrapper .class-card:hover {
    transform: translateY(-3px);
}

.ngc-wrapper .class-header {
    background-color: #3498db;
    color: white;
    padding: 20px;
}

.ngc-wrapper .class-header h3 {
    margin: 0;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ngc-wrapper .class-name-input {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.4rem;
    font-weight: bold;
    width: 100%;
    padding: 5px;
}

.ngc-wrapper .class-name-input::placeholder {
    color: rgba(255, 255, 255, 0.8);
}

.ngc-wrapper .class-name-input:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

/* Grade summary */
.ngc-wrapper .grade-summary {
    padding: 15px 20px;
    background-color: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e1e5eb;
}

.ngc-wrapper .grade-display {
    font-size: 1.3rem;
    font-weight: bold;
}

.ngc-wrapper .letter-grade {
    font-size: 1.8rem;
    font-weight: bold;
}

/* Table styling */
.ngc-wrapper table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.ngc-wrapper th,
.ngc-wrapper td {
    padding: 15px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.ngc-wrapper th {
    background: #f1f5f9;
    font-weight: 600;
    color: #2c3e50;
}

.ngc-wrapper input,
.ngc-wrapper select {
    width: 100% !important;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    max-width: 100%;
}

.ngc-wrapper input:focus,
.ngc-wrapper select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Buttons */
.ngc-wrapper .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 6px;
}

.ngc-wrapper .btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.ngc-wrapper .btn-primary {
    background-color: #3498db;
    color: white;
}

.ngc-wrapper .btn-primary:hover {
    background-color: #2980b9;
}

.ngc-wrapper .btn-success {
    background-color: #2ecc71;
    color: white;
}

.ngc-wrapper .btn-success:hover {
    background-color: #27ae60;
}

.ngc-wrapper .btn-danger {
    background-color: #e74c3c;
    color: white;
}

.ngc-wrapper .btn-danger:hover {
    background-color: #c0392b;
}

/* Remove button */
.ngc-wrapper .remove-btn {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.2s;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ngc-wrapper .remove-btn:hover {
    background-color: rgba(231, 76, 60, 0.1);
}

/* Overall GPA */
.ngc-wrapper .overall-gpa {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 25px;
    margin-top: 40px;
    text-align: center;
}

.ngc-wrapper .gpa-display {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2c3e50;
    margin: 10px 0;
}

/* Grade scale info */
.ngc-wrapper .grade-scale-info {
    margin-top: 40px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 25px;
}

.ngc-wrapper .grade-scale-info h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ngc-wrapper .scale-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.ngc-wrapper .scale-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
    font-size: 1.3rem;  
    color: #000;        
}

/* Global controls */
.ngc-wrapper .global-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
    justify-content: center;
}

/* Class-actions & Table-actions button spacing */
.ngc-wrapper .class-actions,
.ngc-wrapper .table-actions {
    display: flex;
    gap: 10px;  /* fixes buttons stuck together */
    flex-wrap: wrap;
}

/* Mobile responsive */
@media(max-width: 650px) {
    .ngc-wrapper table, 
    .ngc-wrapper thead, 
    .ngc-wrapper tbody, 
    .ngc-wrapper th, 
    .ngc-wrapper td, 
    .ngc-wrapper tr {
        display: block;
        width: 100%;
    }
  

    .ngc-wrapper th { display: none; }

    .ngc-wrapper tr {
        margin-bottom: 15px;
        background: #fff;
        padding: 12px;
        border-radius: 10px;
        border: 1px solid #e5e7eb;
        box-sizing: border-box;
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-gap: 10px;
        overflow: hidden;
    }

    .ngc-wrapper td {
        border: 0;
        padding: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .ngc-wrapper td:before {
        content: attr(data-label);
        font-weight: bold;
        display: block;
        margin-bottom: 4px;
        color: #6b7280;
    }

    .ngc-wrapper .global-controls, 
    .ngc-wrapper .table-actions, 
    .ngc-wrapper .class-actions {
        flex-direction: column;
    }

    .ngc-wrapper .btn {
        width: 100%;
        justify-content: center;
    }

    .ngc-wrapper .grade-summary {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media(min-width: 651px) and (max-width: 900px) {
    .ngc-wrapper tr {
        grid-template-columns: 1fr 1fr;
    }
}

/* --- End Fully Scoped CSS --- */
