/**
 * KSU Services Marketplace - Main Stylesheet
 * Official KSU Brand Colors and Typography
 * Based on https://ksu.edu.sa/ official website
 */

/* KSU Official Fonts - Same as ksu.edu.sa */
@import url('https://fonts.googleapis.com/css2?family=Dosis:wght@300;400;500;600;700;800&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

/* GE-Dinar Font - KSU Official Arabic Font */
@font-face {
    font-family: 'GE Dinar One';
    src: url('fonts/GEDinarOne-Medium.woff2') format('woff2'),
         url('fonts/GEDinarOne-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

:root {
    /* KSU Official Colors - Based on ksu.edu.sa */
    --mainSiteColor: #017eb3; /* KSU Main Color */
    --ksu-primary: #017eb3; /* KSU Blue */
    --ksu-secondary: #D4AF37; /* KSU Gold/Cream */
    --ksu-green: #165a43; /* KSU Green (accent) */
    --ksu-dark: #001a33;
    --ksu-light: #f5f5f5;
    
    /* UI Colors */
    --primary-color: #017eb3;
    --secondary-color: #D4AF37;
    --bg-color: #ffffff;
    --text-color: #333333;
    --light-gray: #e9ecef;
    --border-color: #dee2e6;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 5px 20px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Dosis","GE Dinar One",sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.8;
    direction: rtl;
    text-align: right;
    font-size: 16px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--mainSiteColor);
    margin-bottom: 1rem;
    font-family: "Dosis","GE Dinar One",sans-serif;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: #555;
}

a {
    color: var(--mainSiteColor);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--mainSiteColor);
    opacity: 0.8;
}

/* Header & Navigation */
.navbar {
    background: #fff;
    box-shadow: var(--shadow);
    padding: 1rem 0;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ksu-primary) !important;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-brand .ksu-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
    margin-left: 10px;
}

.navbar-brand .ksu-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.navbar-brand .ksu-logo-text .ksu-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ksu-primary);
}

.navbar-brand .ksu-logo-text .ksu-subtitle {
    font-size: 0.75rem;
    font-weight: 400;
    color: #666;
}

.navbar-nav .nav-link {
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: var(--transition);
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color);
}

.cart-badge {
    background: var(--mainSiteColor);
    color: white;
    border-radius: 50%;
    padding: 0;
    font-size: 0.7rem;
    font-weight: 700;
    position: absolute;
    top: -8px;
    left: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.navbar-nav .nav-item.position-relative {
    margin-left: 15px;
}

.navbar-nav .nav-item.position-relative {
    margin-left: 15px;
}

.navbar-nav .nav-item.position-relative .nav-link {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-width: 55px;
    height: 45px;
}

.navbar-nav .nav-item.position-relative .nav-link i {
    font-size: 1.4rem;
    color: var(--mainSiteColor);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--mainSiteColor);
    color: white;
    border: none;
    font-weight: 600;
}

.btn-primary:hover {
    background: #016699;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    color: white;
}

.btn-secondary {
    background: var(--ksu-secondary);
    color: var(--ksu-dark);
    border: none;
    font-weight: 600;
}

.btn-secondary:hover {
    background: #c9a030;
    transform: translateY(-2px);
    color: var(--ksu-dark);
}

.btn-outline-primary {
    border: 2px solid var(--mainSiteColor);
    color: var(--mainSiteColor);
    background: transparent;
    font-weight: 600;
}

.btn-outline-primary:hover {
    background: var(--mainSiteColor);
    color: white;
    border-color: var(--mainSiteColor);
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    border: none;
    margin-bottom: 2rem;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-img-top {
    height: 200px;
    object-fit: cover;
    width: 100%;
    transition: transform 0.3s ease;
}

.card:hover .card-img-top {
    transform: scale(1.05);
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--mainSiteColor);
    font-weight: 700;
}

.card-title a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

.card-title a:hover {
    color: var(--mainSiteColor);
    opacity: 0.8;
}

.card-text {
    color: #666;
    margin-bottom: 1rem;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--mainSiteColor) 0%, #016699 100%);
    color: white;
    padding: 5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120"><path d="M0,0v46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z" opacity=".25" fill="%23D4AF37"/><path d="M0,0v15.81C13,36.92,27.64,56.86,47.69,72.05,99.41,111.27,165,111,224.58,91.58c31.15-10.15,60.09-26.07,89.67-39.8,40.92-19,84.73-46,130.83-49.67,36.26-2.85,70.9,9.42,98.6,31.56,31.77,25.39,62.32,62,103.63,73,40.44,10.79,81.35-6.69,119.13-24.28s75.16-39,116.92-43.05c59.73-5.85,113.28,22.88,168.9,38.84,30.2,8.66,59,6.17,87.09-7.5,22.43-10.89,48-26.93,60.65-49.24V0Z" opacity=".5" fill="%23D4AF37"/><path d="M0,0v5.63C149.93,59,314.09,71.32,475.83,42.57c43-7.64,84.23-20.12,127.61-26.46,59-8.63,112.48,12.24,165.56,35.4C827.93,77.22,886,95.24,951.2,90c86.53-7,172.46-45.71,248.8-84.81V0Z" fill="%23D4AF37" opacity=".1"/></svg>') no-repeat center;
    background-size: cover;
    opacity: 0.1;
}

.hero h1 {
    color: white;
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.hero p {
    color: rgba(255,255,255,0.9);
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

/* Search Bar */
.search-bar {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    margin-top: -3rem;
    position: relative;
    z-index: 10;
}

.search-input {
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    width: 100%;
    font-size: 1rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--mainSiteColor);
    box-shadow: 0 0 0 0.2rem rgba(1, 126, 179, 0.25);
}

/* Categories */
.category-card {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    display: block;
    height: 100%;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--mainSiteColor);
}

.category-card:hover .category-icon {
    color: var(--mainSiteColor);
    transform: scale(1.1);
}

.category-card a {
    text-decoration: none;
    color: inherit;
}

.category-icon {
    font-size: 3rem;
    color: var(--mainSiteColor);
    margin-bottom: 1rem;
}

/* Service Card */
.service-card {
    position: relative;
}

.service-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--ksu-secondary);
    color: var(--ksu-dark);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 700;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Currency Symbol Styling */
.currency-symbol {
    display: inline-block;
    margin-left: 4px;
    margin-right: 0;
    font-weight: 600;
    color: inherit;
}

[dir="rtl"] .currency-symbol {
    margin-right: 4px;
    margin-left: 0;
	float:left;
}

.service-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--mainSiteColor);
    margin: 1rem 0;
}

.service-rating {
    color: var(--warning-color);
    margin-bottom: 0.5rem;
}

/* Vendor Badge */
.vendor-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--light-gray);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
}

.verified-badge {
    color: var(--success-color);
}

/* Footer - Matching KSU Official Design */
.footer {
    background: var(--mainSiteColor);
    color: white;
    padding: 0;
    margin-top: 5rem;
}

.footer-top {
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding: 2rem 0;
}

.footer-social {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-social a {
    color: white;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
    text-decoration: none;
}

.footer-social a:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-3px);
}

.footer-middle {
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding: 3rem 0;
}

.footer h5 {
    color: white;
    margin-bottom: 1.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    font-family: "Dosis","GE Dinar One",sans-serif;
}

.footer .footer-col {
    margin-bottom: 2rem;
}

.footer .footer-col a {
    color: rgba(255,255,255,0.9);
    display: block;
    margin-bottom: 0.75rem;
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.95rem;
    font-family: "Dosis","GE Dinar One",sans-serif;
}

.footer .footer-col a:hover {
    color: white;
    padding-right: 5px;
}

.footer .footer-col p {
    color: rgba(255,255,255,0.9);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    font-family: "Dosis","GE Dinar One",sans-serif;
}

.footer-app-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.footer-app-links i {
    font-size: 1.2rem;
    margin-left: 0.25rem;
}

.footer-app-links img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.footer-bottom {
    padding: 2rem 0;
    text-align: center;
    background: rgba(0,0,0,0.1);
}

.footer-bottom p {
    color: rgba(255,255,255,0.8);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-family: "Dosis","GE Dinar One",sans-serif;
}

.footer-bottom a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    margin: 0 0.5rem;
    font-family: "Dosis","GE Dinar One",sans-serif;
}

.footer-bottom a:hover {
    color: white;
}

/* Forms */
.form-control {
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(22, 90, 67, 0.25);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

/* Alerts */
.alert {
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border: none;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* Badges */
.badge {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
}

.badge-success {
    background: var(--success-color);
    color: white;
}

.badge-warning {
    background: var(--warning-color);
    color: #333;
}

.badge-danger {
    background: var(--danger-color);
    color: white;
}

.badge-info {
    background: var(--info-color);
    color: white;
}

/* Loading Spinner */
.spinner {
    border: 4px solid var(--light-gray);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Utilities */
.text-primary { color: var(--mainSiteColor) !important; }
.text-secondary { color: var(--ksu-secondary) !important; }
.bg-primary { background-color: var(--mainSiteColor) !important; }
.bg-secondary { background-color: var(--ksu-secondary) !important; }

.mt-5 { margin-top: 3rem; }
.mb-5 { margin-bottom: 3rem; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }

/* Section Spacing */
.section {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-title p {
    color: #666;
    font-size: 1.1rem;
}

/* Step Indicator - Basic styles, overridden by vendor-dashboard.css for vendor forms */
.step-indicator {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3rem;
    position: relative;
    max-width: 750px;
    margin: 0 auto 3rem;
    gap: 0.5rem;
    padding: 0 15px;
}

.step-indicator::before {
    content: '';
    position: absolute;
    top: 25px;
    right: 25px;
    left: 25px;
    height: 3px;
    background: var(--light-gray);
    z-index: 1;
    border-radius: 2px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 2;
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
    min-width: 0;
}

.step .step-number {
    background: white;
    border: 3px solid var(--light-gray);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    position: relative;
    transition: var(--transition);
    font-family: "Dosis","GE Dinar One",sans-serif;
    flex-shrink: 0;
}

.step .step-label {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
    font-weight: 500;
    transition: var(--transition);
    white-space: normal;
    line-height: 1.4;
    word-break: break-word;
    width: 100%;
}

.step.active .step-number {
    border-color: var(--mainSiteColor);
    background: var(--mainSiteColor);
    color: white;
    box-shadow: 0 0 0 4px rgba(1, 126, 179, 0.2);
}

.step.active .step-label {
    color: var(--mainSiteColor);
    font-weight: 600;
}

.step.completed .step-number {
    border-color: var(--success-color);
    background: var(--success-color);
    color: white;
}

.step.completed .step-label {
    color: var(--success-color);
}

.step:hover:not(.active):not(.completed) .step-number {
    border-color: #d0d0d0;
    transform: scale(1.05);
}

/* Checkout Page Styling */
.checkout-container {
    min-height: 60vh;
}

.checkout-summary-card {
    position: sticky;
    top: 120px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

.checkout-form-card {
    min-height: 500px;
}

/* Order Summary Items */
#orderSummary {
    padding: 0.5rem 0;
}

#orderSummary > div {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

#orderSummary > div:last-child {
    border-bottom: none;
}

#orderSummary .d-flex {
    align-items: flex-start;
}

#orderSummary span:first-child {
    flex: 1;
    word-break: break-word;
    padding-left: 0.5rem;
}

/* Currency Symbol in RTL */
[dir="rtl"] .currency-symbol {
    margin-right: 4px;
    margin-left: 0;
}

/* Price Alignment */
.service-price,
.price-display {
    display: inline-block;
}

.service-price .currency-symbol,
.price-display .currency-symbol {
    margin-right: 4px;
    margin-left: 0;
    font-weight: 700;
}

/* Ensure numbers are displayed LTR within RTL context */
.price-number {
    direction: ltr;
    display: inline-block;
    unicode-bidi: embed;
}

/* Responsive adjustments for checkout */
@media (max-width: 991px) {
    .checkout-summary-card {
        position: relative;
        top: 0;
        margin-bottom: 2rem;
    }
}

