/* Layout Styles for Solar Quotation System */

/* Top Header */
.top-header {
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3d6f 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.logo i {
    font-size: 2rem;
    margin-right: 0.5rem;
}

.logo-text {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.3s ease;
}

.sidebar-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Search Box */
.search-box {
    min-width: 300px;
}

.search-box .form-control {
    border-radius: 25px;
    padding-left: 2.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.search-box .form-control::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-box .form-control:focus {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
}

.search-box .btn {
    border-radius: 0 25px 25px 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.search-box .btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Notification Dropdown */
.notification-dropdown .btn {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.notification-dropdown .btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

/* User Dropdown */
.user-dropdown .btn {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 25px;
    padding: 0.5rem 1rem;
}

.user-dropdown .btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Mobile Menu */
.mobile-menu .btn {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu .btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.mobile-menu .dropdown-menu {
    min-width: 200px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.mobile-menu .dropdown-item {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

.mobile-menu .dropdown-item i {
    width: 16px;
    text-align: center;
}

/* Main Wrapper */
.main-wrapper {
    display: flex;
    min-height: calc(100vh - 80px);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 80px;
    left: 0;
    height: calc(100vh - 80px);
    overflow-y: auto;
    z-index: 999;
    transition: transform 0.3s ease;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 1.5rem 1rem 1rem;
    border-bottom: 1px solid #e9ecef;
}

.sidebar-title {
    color: #2c5aa0;
    font-weight: 600;
    margin: 0;
    font-size: 1.1rem;
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #6c757d;
    text-decoration: none;
    border-radius: 0;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar-nav .nav-link:hover {
    background-color: #f8f9fa;
    color: #2c5aa0;
    transform: translateX(5px);
}

.sidebar-nav .nav-link.active {
    background-color: #e3f2fd;
    color: #2c5aa0;
    font-weight: 600;
}

.sidebar-nav .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #2c5aa0;
}

.sidebar-nav .nav-link i {
    width: 20px;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.sidebar-nav .nav-link span {
    flex: 1;
}

.sidebar-nav .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
}

.sidebar-info {
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 0;
    background-color: #f5f6fa;
    min-height: calc(100vh - 80px);
    transition: margin-left 0.3s ease;
}

.main-content.expanded {
    margin-left: 0;
}

/* Breadcrumb */
.breadcrumb-nav {
    background: white;
    padding: 1rem 2rem;
    margin-bottom: 0;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.breadcrumb {
    margin: 0;
    background: none;
    padding: 0;
}

.breadcrumb-item {
    font-size: 0.9rem;
}

.breadcrumb-item a {
    color: #2c5aa0;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: #1e3d6f;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #6c757d;
}

/* Content Area */
.content-area {
    padding: 2rem;
}

/* Page Header */
.page-header {
    background: white;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.page-title {
    color: #2c5aa0;
    font-weight: 700;
    margin: 0;
    font-size: 2rem;
}

.page-subtitle {
    color: #6c757d;
    margin: 0.5rem 0 0;
    font-size: 1.1rem;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stat-card-title {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
}

.stat-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2c5aa0;
    margin: 0;
}

.stat-card-change {
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.stat-card-change.positive {
    color: #28a745;
}

.stat-card-change.negative {
    color: #dc3545;
}

/* Content Cards */
.content-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.content-card-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-card-title {
    color: #2c5aa0;
    font-weight: 600;
    margin: 0;
    font-size: 1.2rem;
}

.content-card-body {
    padding: 1.5rem;
}

/* Responsive Design */

/* Large Tablets and Small Desktops */
@media (max-width: 1200px) {
    .sidebar {
        width: 250px;
    }
    
    .main-content {
        margin-left: 250px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
    
    .search-box {
        min-width: 250px;
    }
}

/* Tablets */
@media (max-width: 992px) {
    .sidebar {
        width: 220px;
    }
    
    .main-content {
        margin-left: 220px;
    }
    
    .page-header {
        padding: 1.5rem;
    }
    
    .content-card-header {
        padding: 1.25rem;
    }
    
    .content-card-body {
        padding: 1.25rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .search-box {
        min-width: 200px;
    }
    
    .logo-text {
        font-size: 1.25rem;
    }
}

/* Mobile Landscape and Small Tablets */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        z-index: 1050;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .top-header {
        padding: 0.75rem 0;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .logo-text {
        display: none;
    }
    
    .search-box {
        min-width: 180px;
        margin-right: 0.5rem;
    }
    
    .breadcrumb-nav {
        padding: 0.75rem 1rem;
    }
    
    .content-area {
        padding: 1rem;
    }
    
    .page-header {
        padding: 1.25rem;
        margin-bottom: 1.5rem;
    }
    
    .page-title {
        font-size: 1.75rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.25rem;
    }
    
    .stat-card-value {
        font-size: 1.75rem;
    }
    
    .content-card-header {
        padding: 1rem;
    }
    
    .content-card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .notification-dropdown .btn,
    .user-dropdown .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* Mobile Portrait */
@media (max-width: 576px) {
    .top-header .container-fluid {
        padding: 0 1rem;
    }
    
    .top-header .row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .top-header .col-md-6:last-child {
        margin-top: 0;
        width: 100%;
    }
    
    .search-box {
        min-width: 100%;
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .notification-dropdown,
    .user-dropdown {
        margin-left: 0.25rem;
        margin-right: 0.25rem;
    }
    
    .sidebar {
        width: 100%;
        top: 60px;
        height: calc(100vh - 60px);
    }
    
    .main-content {
        margin-top: 0;
    }
    
    .breadcrumb-nav {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .content-area {
        padding: 0.75rem;
    }
    
    .page-header {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .page-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .page-subtitle {
        font-size: 0.9rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card-header {
        margin-bottom: 0.75rem;
    }
    
    .stat-card-title {
        font-size: 0.8rem;
    }
    
    .stat-card-value {
        font-size: 1.5rem;
    }
    
    .stat-card-change {
        font-size: 0.75rem;
    }
    
    .content-card-header {
        padding: 0.75rem;
    }
    
    .content-card-body {
        padding: 0.75rem;
    }
    
    .content-card-header .row {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .content-card-header .col-md-4,
    .content-card-header .col-md-6 {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
    }
    
    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-content {
        border-radius: 8px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
}

/* Extra Small Devices */
@media (max-width: 375px) {
    .top-header {
        padding: 0.5rem 0;
    }
    
    .logo {
        font-size: 1.1rem;
    }
    
    .search-box .form-control {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    .search-box .btn {
        padding: 0.5rem;
    }
    
    .notification-dropdown .btn,
    .user-dropdown .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .breadcrumb-nav {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .content-area {
        padding: 0.5rem;
    }
    
    .page-header {
        padding: 0.75rem;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .page-subtitle {
        font-size: 0.85rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-card-value {
        font-size: 1.25rem;
    }
    
    .content-card-header,
    .content-card-body {
        padding: 0.75rem;
    }
    
    .table th,
    .table td {
        padding: 0.375rem 0.125rem;
        font-size: 0.75rem;
    }
    
    .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* Landscape Orientation */
@media (max-height: 500px) and (orientation: landscape) {
    .sidebar {
        height: calc(100vh - 60px);
    }
    
    .page-header {
        padding: 0.75rem 1rem;
        margin-bottom: 1rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-card-value {
        font-size: 1.25rem;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo i {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    .sidebar-nav .nav-link i {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .top-header,
    .breadcrumb-nav,
    .btn,
    .modal {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .content-area {
        padding: 0 !important;
    }
    
    .page-header {
        padding: 0.5rem 0 !important;
        margin-bottom: 1rem !important;
    }
    
    .content-card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
        break-inside: avoid;
    }
    
    .table {
        font-size: 0.75rem !important;
    }
    
    .table th,
    .table td {
        padding: 0.25rem !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .sidebar {
        background-color: #2d3748;
        color: white;
    }
    
    .sidebar-nav .nav-link {
        color: #a0aec0;
    }
    
    .sidebar-nav .nav-link:hover {
        background-color: #4a5568;
        color: white;
    }
    
    .sidebar-nav .nav-link.active {
        background-color: #2c5aa0;
        color: white;
    }
    
    .main-content {
        background-color: #1a202c;
    }
    
    .breadcrumb-nav {
        background-color: #2d3748;
        border-bottom-color: #4a5568;
    }
    
    .content-card {
        background-color: #2d3748;
        color: white;
    }
    
    .content-card-header {
        border-bottom-color: #4a5568;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.slide-in-left {
    animation: slideInLeft 0.3s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Search Results Dropdown */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

.search-results-header {
    padding: 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    color: #2c5aa0;
}

.search-results-section {
    padding: 0.5rem 0;
}

.search-results-section h6 {
    padding: 0.5rem 1rem;
    margin: 0;
    background-color: #f8f9fa;
    color: #6c757d;
    font-size: 0.875rem;
    font-weight: 600;
}

.search-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-no-results {
    padding: 1rem;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2c5aa0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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