/* Student Password Changer Styles */

/* Main Container */
.spc-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 1000px;
    margin: 20px auto;
    padding: 24px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.spc-container h2 {
    margin: 0 0 24px;
    font-size: 24px;
    color: #1e293b;
    text-align: center;
}

/* Group Selector */
.spc-group-selector {
    margin-bottom: 32px;
}

.spc-group-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
    font-size: 15px;
}

.spc-dropdown {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    color: #1f2937;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.spc-dropdown:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* No Students Message */
.spc-no-students {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    font-size: 15px;
    font-style: italic;
}

/* Students Grid - Desktop Layout */
.spc-students-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Student Card - Desktop: Horizontal Layout */
.spc-student-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s;
}

.spc-student-card:hover {
    background: #f3f4f6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Student Name */
.spc-student-name {
    flex: 0 0 200px;
    font-weight: 600;
    color: #1f2937;
    font-size: 15px;
}

/* Password Section */
.spc-password-section {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0; /* Allow text truncation */
}

.spc-password-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.spc-password-value {
    flex: 1;
    min-width: 0;
}

.spc-password-placeholder {
    color: #9ca3af;
    font-style: italic;
    font-size: 14px;
}

.spc-password-text {
    font-weight: 600;
    color: #059669;
    font-size: 16px;
    font-family: 'Courier New', monospace;
}

/* Copy Button */
.spc-copy-btn {
    padding: 6px 10px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.spc-copy-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    transform: scale(1.05);
}

.spc-copy-btn:active {
    transform: scale(0.95);
}

.spc-copy-btn.copied {
    background: #d1fae5;
    border-color: #10b981;
}

/* Reset Button */
.spc-reset-btn {
    flex-shrink: 0;
    padding: 10px 20px;
    background: #3b82f6;
    color: #fff;
    border: 1px solid #3b82f6;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.spc-reset-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
}

.spc-reset-btn:active {
    transform: translateY(0);
}

.spc-reset-btn:disabled {
    background: #9ca3af;
    border-color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* Success State for Card */
.spc-student-card.password-reset {
    background: #f0fdf4;
    border-color: #86efac;
}

/* Mobile Layout - Stack Everything Vertically */
@media (max-width: 768px) {
    .spc-container {
        margin: 10px;
        padding: 16px;
    }

    .spc-container h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .spc-group-selector {
        margin-bottom: 24px;
    }

    .spc-students-grid {
        gap: 16px;
    }

    /* Stack card contents vertically */
    .spc-student-card {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 16px;
    }

    .spc-student-name {
        flex: none;
        font-size: 16px;
        text-align: center;
        padding-bottom: 8px;
        border-bottom: 1px solid #e5e7eb;
    }

    .spc-password-section {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .spc-password-label {
        font-size: 13px;
        text-align: center;
    }

    .spc-password-value {
        text-align: center;
    }

    .spc-password-text {
        font-size: 18px;
    }

    .spc-copy-btn {
        align-self: center;
        padding: 8px 16px;
        font-size: 18px;
    }

    .spc-reset-btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 15px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .spc-container {
        padding: 12px;
    }

    .spc-container h2 {
        font-size: 18px;
    }

    .spc-student-card {
        padding: 14px;
    }

    .spc-student-name {
        font-size: 15px;
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.spc-reset-btn:disabled {
    animation: pulse 1.5s ease-in-out infinite;
}