/* Common CSS for CertEdNow */

/* Brand Color Variables are now defined in brand-specific stylesheets only */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
}



/* Loading Spinner */
.loading {
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* ============================================================================
   BUTTON SYSTEM - Consistent styling for all buttons across the site
   ============================================================================ */

/* Base Button Styles */
.btn, .button,
a.btn, a.button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none !important;
    display: inline-block;
    text-align: center;
    font-family: inherit;
    line-height: 1.5;
}

/* Ensure buttons styled as links never have underlines */
a.btn, a.button,
a.btn-primary, a.btn-secondary, a.btn-success, a.btn-danger, a.btn-warning,
a.nav-button, a.prev-button, a.next-button, a.submit-button,
a.action-button, a.retry-button, a.home-button,
a.btn-purchase, a.btn-download, a.btn-certificate, a.btn-back, a.back-button {
    text-decoration: none !important;
}

a.btn:hover, a.button:hover,
a.btn-primary:hover, a.btn-secondary:hover, a.btn-success:hover, a.btn-danger:hover, a.btn-warning:hover,
a.nav-button:hover, a.prev-button:hover, a.next-button:hover, a.submit-button:hover,
a.action-button:hover, a.retry-button:hover, a.home-button:hover,
a.btn-purchase:hover, a.btn-download:hover, a.btn-certificate:hover, a.btn-back:hover, a.back-button:hover {
    text-decoration: none !important;
}

/* Button Variants */
.btn-primary, .button.primary, .admin-btn,
a.btn-primary, a.button.primary {
    background: linear-gradient( 135deg, var( --brand-primary ) 0%, var( --brand-secondary ) 100% );
    color: white;
    box-shadow: 0 4px 12px var( --brand-shadow-primary );
    text-decoration: none !important;
}

.btn-primary:hover, .button.primary:hover, .admin-btn:hover,
.btn-primary:focus, .button.primary:focus, .admin-btn:focus,
a.btn-primary:hover, a.button.primary:hover {
    transform: translateY( -2px );
    box-shadow: 0 6px 20px var( --brand-shadow-primary-hover );
    text-decoration: none !important;
}

.btn-primary:active, .button.primary:active, .admin-btn:active,
a.btn-primary:active, a.button.primary:active {
    transform: translateY( 0 );
}

.btn-secondary,
a.btn-secondary {
    background: #6c757d;
    color: white;
    text-decoration: none !important;
}

.btn-secondary:hover, .btn-secondary:focus,
a.btn-secondary:hover, a.btn-secondary:focus {
    background: #5a6268;
    transform: translateY( -1px );
    box-shadow: 0 4px 8px rgba( 108, 117, 125, 0.3 );
    text-decoration: none !important;
}

.btn-secondary:active,
a.btn-secondary:active {
    transform: translateY( 0 );
}

.btn-success,
a.btn-success {
    background: linear-gradient( 135deg, #28a745 0%, #20c997 100% );
    color: white;
    box-shadow: 0 4px 12px rgba( 40, 167, 69, 0.3 );
    text-decoration: none !important;
}

.btn-success:hover, .btn-success:focus,
a.btn-success:hover, a.btn-success:focus {
    transform: translateY( -2px );
    box-shadow: 0 6px 20px rgba( 40, 167, 69, 0.4 );
    text-decoration: none !important;
}

.btn-success:active,
a.btn-success:active {
    transform: translateY( 0 );
}

.btn-danger, .button.danger,
a.btn-danger, a.button.danger {
    background: #dc3545;
    color: white;
    box-shadow: 0 4px 12px rgba( 220, 53, 69, 0.3 );
    text-decoration: none !important;
}

.btn-danger:hover, .button.danger:hover,
.btn-danger:focus, .button.danger:focus,
a.btn-danger:hover, a.button.danger:hover,
a.btn-danger:focus, a.button.danger:focus {
    background: #c82333;
    transform: translateY( -1px );
    box-shadow: 0 4px 8px rgba( 220, 53, 69, 0.3 );
    text-decoration: none !important;
}

.btn-danger:active, .button.danger:active,
a.btn-danger:active, a.button.danger:active {
    transform: translateY( 0 );
}

.btn-warning,
a.btn-warning {
    background: #ffc107;
    color: #333;
    box-shadow: 0 4px 12px rgba( 255, 193, 7, 0.3 );
    text-decoration: none !important;
}

.btn-warning:hover, .btn-warning:focus,
a.btn-warning:hover, a.btn-warning:focus {
    background: #e0a800;
    transform: translateY( -1px );
    box-shadow: 0 4px 8px rgba( 255, 193, 7, 0.3 );
    text-decoration: none !important;
}

.btn-warning:active,
a.btn-warning:active {
    transform: translateY( 0 );
}

/* Button Sizes */
.btn-small, .button.small {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-large {
    padding: 16px 32px;
    font-size: 16px;
}

/* Hero Buttons (for landing pages) */
.btn-hero {
    padding: 18px 36px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    min-width: 180px;
}

.btn-primary-hero {
    background: rgba( 255, 255, 255, 0.2 );
    color: white;
    border: 2px solid rgba( 255, 255, 255, 0.3 );
}

.btn-primary-hero:hover {
    background: rgba( 255, 255, 255, 0.3 );
    transform: translateY( -3px );
    box-shadow: 0 15px 30px rgba( 0, 0, 0, 0.2 );
}

.btn-secondary-hero {
    background: white;
    color: var( --brand-primary );
    border: 2px solid white;
}

.btn-secondary-hero:hover {
    background: transparent;
    color: white;
    transform: translateY( -3px );
    box-shadow: 0 15px 30px rgba( 0, 0, 0, 0.2 );
}

/* Special Purpose Buttons */
.btn-purchase,
a.btn-purchase {
    background: linear-gradient( 135deg, var( --brand-primary ) 0%, var( --brand-secondary ) 100% );
    color: white;
    text-decoration: none !important;
}

.btn-purchase:hover,
a.btn-purchase:hover {
    transform: translateY( -2px );
    box-shadow: 0 8px 25px var( --brand-shadow-primary );
    text-decoration: none !important;
}

.btn-download, .btn-certificate,
a.btn-download, a.btn-certificate {
    background: linear-gradient( 135deg, #28a745 0%, #20c997 100% );
    color: white;
    text-decoration: none !important;
}

.btn-download:hover, .btn-certificate:hover,
a.btn-download:hover, a.btn-certificate:hover {
    transform: translateY( -2px );
    box-shadow: 0 8px 25px rgba( 40, 167, 69, 0.3 );
    text-decoration: none !important;
}

.btn-back, .back-button,
a.btn-back, a.back-button {
    background: #6c757d;
    color: white;
    text-decoration: none !important;
}

.btn-back:hover, .back-button:hover,
a.btn-back:hover, a.back-button:hover {
    background: #5a6268;
    transform: translateY( -1px );
    text-decoration: none !important;
}

.btn-close, .close-button {
    background: transparent;
    color: #666;
    border: none;
    padding: 8px;
    font-size: 24px;
    line-height: 1;
}

.btn-close:hover, .close-button:hover {
    color: #333;
    background: rgba( 0, 0, 0, 0.05 );
    border-radius: 4px;
}

/* Navigation Buttons - Use standard button system */
.nav-button, .next-button, .submit-button {
    /* Inherit from btn-primary */
}

.nav-button, .next-button, .submit-button,
a.nav-button, a.next-button, a.submit-button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    background: linear-gradient( 135deg, var( --brand-primary ) 0%, var( --brand-secondary ) 100% );
    color: white;
    box-shadow: 0 4px 12px var( --brand-shadow-primary );
}

.nav-button:hover, .next-button:hover, .submit-button:hover,
a.nav-button:hover, a.next-button:hover, a.submit-button:hover {
    transform: translateY( -2px );
    box-shadow: 0 6px 20px var( --brand-shadow-primary-hover );
    text-decoration: none;
}

.nav-button:active, .next-button:active, .submit-button:active,
a.nav-button:active, a.next-button:active, a.submit-button:active {
    transform: translateY( 0 );
}

.nav-button:disabled, .next-button:disabled, .submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.nav-button:disabled:hover, .next-button:disabled:hover, .submit-button:disabled:hover {
    transform: none !important;
    box-shadow: 0 4px 12px var( --brand-shadow-primary ) !important;
}

/* Previous Button - Use secondary style */
.prev-button, a.prev-button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    background: #6c757d;
    color: white;
}

.prev-button:hover, a.prev-button:hover {
    background: #5a6268;
    transform: translateY( -1px );
    box-shadow: 0 4px 8px rgba( 108, 117, 125, 0.3 );
    text-decoration: none;
}

.prev-button:active, a.prev-button:active {
    transform: translateY( 0 );
}

.prev-button:disabled, a.prev-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.prev-button:disabled:hover, a.prev-button:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Action Buttons - Use standard button system */
.action-button, .retry-button {
    /* Inherit from btn-primary */
}

.action-button, .retry-button,
a.action-button, a.retry-button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    background: linear-gradient( 135deg, var( --brand-primary ) 0%, var( --brand-secondary ) 100% );
    color: white;
    box-shadow: 0 4px 12px var( --brand-shadow-primary );
}

.action-button:hover, .retry-button:hover,
a.action-button:hover, a.retry-button:hover {
    transform: translateY( -2px );
    box-shadow: 0 6px 20px var( --brand-shadow-primary-hover );
    text-decoration: none;
}

.action-button:active, .retry-button:active,
a.action-button:active, a.retry-button:active {
    transform: translateY( 0 );
}

/* Home Button - Use secondary style */
.home-button, a.home-button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    background: #6c757d;
    color: white;
}

.home-button:hover, a.home-button:hover {
    background: #5a6268;
    transform: translateY( -1px );
    box-shadow: 0 4px 8px rgba( 108, 117, 125, 0.3 );
    text-decoration: none;
}

.home-button:active, a.home-button:active {
    transform: translateY( 0 );
}

/* Tab Buttons */
.tab-button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px 8px 0 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
    color: #666;
}

.tab-button:hover {
    background: #e9ecef;
    color: #333;
}

.tab-button.active {
    background: white;
    color: var( --brand-primary );
    border-bottom: 3px solid var( --brand-primary );
}

/* Simulator Buttons */
.btn-simulator {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-simulator-success {
    background: #28a745;
    color: white;
}

.btn-simulator-success:hover {
    background: #218838;
    transform: translateY( -2px );
    box-shadow: 0 4px 12px rgba( 40, 167, 69, 0.3 );
}

.btn-simulator-fail {
    background: #dc3545;
    color: white;
}

.btn-simulator-fail:hover {
    background: #c82333;
    transform: translateY( -2px );
    box-shadow: 0 4px 12px rgba( 220, 53, 69, 0.3 );
}

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

.btn-simulator-cancel:hover {
    background: #5a6268;
    transform: translateY( -2px );
    box-shadow: 0 4px 12px rgba( 108, 117, 125, 0.3 );
}

/* Browse and Search Buttons */
.browse-button, .search-button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient( 135deg, var( --brand-primary ) 0%, var( --brand-secondary ) 100% );
    color: white;
}

.browse-button:hover, .search-button:hover {
    transform: translateY( -2px );
    box-shadow: 0 6px 20px var( --brand-shadow-primary-hover );
}

/* CTA Buttons */
.btn-cta, .btn-green {
    background: linear-gradient( 135deg, #28a745 0%, #20c997 100% );
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-cta:hover, .btn-green:hover {
    transform: translateY( -2px );
    box-shadow: 0 6px 20px rgba( 40, 167, 69, 0.4 );
}

.btn-cta:active, .btn-green:active {
    transform: translateY( 0 );
}

/* Disabled State */
.btn:disabled, .button:disabled,
.btn-primary:disabled, .btn-secondary:disabled,
.btn-success:disabled, .btn-danger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn:disabled:hover, .button:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* ============================================================================
   FORM SYSTEM - Consistent styling for all form elements
   ============================================================================ */

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

/* Standardize all form inputs */
.form-group input,
.form-group select,
.form-group textarea,
.form-input,
.form-textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    font-family: inherit;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-input:focus,
.form-textarea:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var( --brand-focus-color );
    background: white;
    box-shadow: 0 0 0 3px var( --brand-shadow-focus );
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover,
.form-input:hover,
.form-textarea:hover,
input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
input[type="search"]:hover,
input[type="tel"]:hover,
input[type="url"]:hover,
select:hover,
textarea:hover {
    border-color: var( --brand-border-color );
    background-color: white;
}

/* Select specific styles */
.form-group select,
select {
    cursor: pointer;
    appearance: none;
    background-image: url( "data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e" );
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Textarea specific styles */
.form-group textarea,
.form-textarea,
textarea {
    resize: vertical;
    min-height: 100px;
}

/* Placeholder styles */
.form-group input::placeholder,
.form-group textarea::placeholder,
.form-input::placeholder,
.form-textarea::placeholder,
input::placeholder,
textarea::placeholder {
    color: #999;
}

.form-group textarea::placeholder,
.form-textarea::placeholder,
textarea::placeholder {
    font-style: italic;
}

/* Password Container */
.password-container {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    font-size: 18px;
}

.password-toggle:hover {
    color: #333;
}

/* Message Styles */
.error-message, .success-message {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.error-message {
    background: #fee;
    color: #c33;
}

.success-message {
    background: #efe;
    color: #3c3;
}

/* Container Styles */
.container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var( --brand-primary ), var( --brand-secondary ));
}

/* Logo Styles */
.logo {
    text-align: center;
    margin-bottom: 30px;
}

/* Link Styles */
.link {
    color: var( --brand-link-color );
    text-decoration: none;
    font-weight: 500;
}

.link:hover {
    color: var( --brand-link-hover );
    text-decoration: underline;
}



/* Password Strength Styles */
.password-strength {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.password-strength.weak {
    color: #c33;
}

.password-strength.medium {
    color: #f90;
}

.password-strength.strong {
    color: #3c3;
}

/* Result status colors */
.result-pass {
    color: #059669;
}

.result-fail {
    color: #dc2626;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 30px 20px;
        margin: 10px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 30px 20px;
        margin: 10px;
    }
}

/* Icon utility class for inline SVG images */
.icon {
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
}

.icon-left {
    margin-right: 8px;
}

/* ============================================================================
   BADGE SYSTEM - Consistent styling for badges across all pages
   Badges are informational labels that should NOT look like buttons
   ============================================================================ */

/* Base Badge Style - Subtle, non-interactive appearance */
.badge,
.course-code,
.course-item-code,
.content-type-badge,
.access-type-badge,
.course-access-source,
.access-code {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    background: #f0f2f5;
    color: #495057;
    border: 1px solid #e1e5e9;
    cursor: default;
    user-select: none;
    /* Explicitly prevent button-like behavior */
    transition: none;
    box-shadow: none;
}

.badge:hover,
.course-code:hover,
.course-item-code:hover,
.content-type-badge:hover,
.access-type-badge:hover,
.course-access-source:hover,
.access-code:hover {
    /* No hover effects - badges are not interactive */
    transform: none;
    box-shadow: none;
    background: #f0f2f5;
    border-color: #e1e5e9;
}

/* Badge Variants - Semantic colors for different states/types */
.badge-success,
.course-access-source.individual {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.badge-info,
.access-type-badge.course {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.access-type-badge.bundle {
    background: #fce7f3;
    color: #9f1239;
    border-color: #fbcfe8;
}

.course-access-source.bundle {
    background: #ede9fe;
    color: #7c3aed;
    border-color: #ddd6fe;
}

/* Special badge styles for specific contexts */
.course-code {
    /* Course codes can be slightly more prominent but still not button-like */
    font-weight: 600;
    font-size: 12px;
}

/* ============================================================================
   UTILITY CLASSES - Common utility classes for consistent styling
   ============================================================================ */

/* Display Utilities */
.hidden {
    display: none !important;
}

/* Text Alignment */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

/* Flexbox Utilities */
.flex {
    display: flex;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Spacing Utilities */
.mt-10 {
    margin-top: 10px;
}

.mt-14 {
    margin-top: 14px;
}

.mt-15 {
    margin-top: 15px;
}

.mt-20 {
    margin-top: 20px;
}

.mt-24 {
    margin-top: 24px;
}

.mt-30 {
    margin-top: 30px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-15 {
    margin-bottom: 15px;
}

.mb-20 {
    margin-bottom: 20px;
}

.pt-20 {
    padding-top: 20px;
}

.pt-30 {
    padding-top: 30px;
}

.pb-20 {
    padding-bottom: 20px;
}
