/* 
 * Green Rays Technology - Solar Site Monitoring
 * Modern Professional White Theme Stylesheet
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #10b981;        /* Emerald Green */
    --primary-hover: #059669;  /* Darker Green */
    --primary-light: #ecfdf5;  /* Emerald Tint */
    --secondary: #0f172a;      /* Slate Blue for text/menus */
    --bg-main: #f8fafc;        /* Soft White */
    --bg-card: #ffffff;        /* Pure White */
    --text-main: #334155;      /* Slate Gray */
    --text-muted: #64748b;     /* Medium Gray */
    --border: #e2e8f0;         /* Light Gray Border */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.02);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    --shadow-lg: 0 10px 15px -3px rgba(16, 185, 129, 0.05), 0 4px 6px -4px rgba(16, 185, 129, 0.03);
    --shadow-focus: 0 0 0 4px rgba(16, 185, 129, 0.15);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* General Resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--secondary);
    font-weight: 700;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

/* Header & Navigation */
header {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition);
}

.header-top {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary);
}

.logo span.green {
    color: var(--primary);
    position: relative;
}

.logo span.green::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary);
    border-radius: 2px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
    padding: 0.5rem 0;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.header-bottom {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    border-top: 1px solid rgba(226, 232, 240, 0.6);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--bg-card);
    border-color: var(--border);
    color: var(--secondary);
}

.btn-secondary:hover {
    background-color: var(--bg-main);
    border-color: var(--text-muted);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary-light);
    color: var(--primary-hover);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.8rem 1.8rem;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

/* Hero Section */
.hero {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 2rem;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 2.5rem;
}

/* Feature Cards & Sections */
.section-container {
    max-width: 1400px;
    margin: 4rem auto;
    padding: 0 2rem;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 2.5rem;
    position: relative;
    padding-bottom: 0.75rem;
    text-align: center;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--primary);
    border-radius: 2px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(16, 185, 129, 0.3);
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--secondary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition);
    background-color: #fff;
    color: var(--text-main);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--shadow-focus);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    padding: 2.5rem;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    border: 1px solid var(--border);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--secondary);
}

.modal-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
}

/* Dashboard Layout */
.dashboard-container {
    max-width: 1600px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
}

.sidebar {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    height: fit-content;
    box-shadow: var(--shadow-sm);
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-link:hover,
.sidebar-link.active {
    background-color: var(--primary-light);
    color: var(--primary-hover);
}

.main-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
    min-height: 600px;
}

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

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.stat-info h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.stat-info p {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--secondary);
}

/* Data Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-top: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}


#admin-sites-table th,
#admin-sites-table td{
    overflow:hidden;
    text-overflow:ellipsis;
}

#admin-sites-table th:nth-child(1){width:90px;}
#admin-sites-table th:nth-child(2){width:140px;}
#admin-sites-table th:nth-child(3){width:250px;}
#admin-sites-table th:nth-child(4){width:100px;}
#admin-sites-table th:nth-child(5){width:120px;}
#admin-sites-table th:nth-child(6){width:140px;}
#admin-sites-table th:nth-child(7){width:80px;}
#admin-sites-table th:nth-child(8){width:120px;}
#admin-sites-table th:nth-child(9){width:120px;}
#admin-sites-table th:nth-child(10){width:130px;}

th, td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

th {
    background-color: var(--bg-main);
    color: var(--secondary);
    font-weight: 700;
    font-family: var(--font-heading);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: rgba(16, 185, 129, 0.02);
}

/* Map Containers */
.map-container {
    width: 100%;
    height: 500px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background-color: #e5e7eb;
    margin-top: 1.5rem;
    overflow: hidden;
    position: relative;
}

/* Site Details Upload Form and Grids */
.site-photo-preview {
    width: 100%;
    height: 200px;
    border-radius: var(--radius-sm);
    border: 2px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    margin-top: 0.5rem;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.site-photo-thumbnail {
    width: 60px;
    height: 45px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border);
}

/* Tabs & Toggle Visibility */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

/* Contact Page Layout */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.contact-info-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.contact-info-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.contact-info-icon {
    color: var(--primary);
    font-size: 1.25rem;
    margin-top: 0.2rem;
}

/* Engineering Map Layout */
.eng-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
}

.eng-site-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.eng-site-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
}

.eng-site-card:hover,
.eng-site-card.active {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
    background-color: var(--primary-light);
}

.eng-site-card h4 {
    font-size: 1rem;
    color: var(--secondary);
    margin-bottom: 0.25rem;
}

.eng-site-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.eng-card-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.btn-danger {
    background-color: #ef4444;
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .dashboard-container {
        grid-template-columns: 1fr;
    }
    
    .eng-grid {
        grid-template-columns: 1fr;
    }
    
    #customer-dashboard-grid {
        grid-template-columns: 1fr !important;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}


/* =========================
   RESPONSIVE FIXES
========================= */



/* ==========================================
   PROFESSIONAL MOBILE RESPONSIVE SYSTEM
========================================== */

html,
body{
    overflow-x:hidden;
}
/* Dashboard Layout */

.dashboard-container{
    display:grid;
    grid-template-columns:280px 1fr;
    gap:24px;
}

.sidebar{
    position:relative;
    top:0;
}





#admin-sites-table th:last-child,
#admin-sites-table td:last-child{
    width:140px;
    min-width:140px;
    text-align:center;
    white-space:nowrap;
}

#admin-sites-table td:last-child .btn{
    padding:4px 8px;
    font-size:11px;
    margin:2px;
}

/* Forms */

form{
    width:100%;
}

.form-control{
    width:100%;
}

/* Images */

img{
    max-width:100%;
    height:auto;
}

/* Tablet */

@media screen and (max-width:1024px){

    .dashboard-container,
    .eng-grid,
    .contact-grid,
    #customer-dashboard-grid{
        display:grid !important;
        grid-template-columns:1fr !important;
    }

    .sidebar{
        position:relative;
        top:0;
    }

    .stats-grid{
        grid-template-columns:repeat(2,1fr);
    }

    .main-content{
        padding:20px;
    }
}

/* Mobile */

@media screen and (max-width:768px){

    header{
        position:relative;
    }

    .header-top{
        flex-direction:column;
        gap:12px;
        text-align:center;
        padding:15px;
    }

    .header-bottom{
        flex-wrap:wrap;
        justify-content:center;
        gap:10px;
        padding:10px;
    }

    .logo{
        font-size:1rem;
    }

    .dashboard-container{
        display:flex;
        flex-direction:column;
        padding:10px;
        gap:15px;
    }

    .sidebar{
        width:100%;
        overflow-x:auto;
        padding:10px;
    }

    .sidebar-menu{
        display:flex;
        flex-direction:row;
        gap:8px;
        overflow-x:auto;
        white-space:nowrap;
        padding-bottom:5px;
    }

    .sidebar-link{
        min-width:max-content;
        padding:10px 14px;
    }

    .main-content{
    width:100%;
    padding:12px;
    overflow-x:hidden;
}
    .stats-grid{
        grid-template-columns:1fr;
    }

    .card{
        padding:15px;
    }

    .hero{
        padding:0 10px;
    }

    .hero h1{
        font-size:1.8rem;
        line-height:1.3;
    }

    .hero p{
        font-size:.95rem;
    }

    .btn{
        width:auto;
    }

    /* all 2 column forms -> single column */

    div[style*="grid-template-columns: 1fr 1fr"]{
        display:flex !important;
        flex-direction:column !important;
        gap:0 !important;
    }

    div[style*="grid-template-columns: 1fr 180px"]{
        display:flex !important;
        flex-direction:column !important;
    }

    div[style*="grid-template-columns: 1fr 200px"]{
        display:flex !important;
        flex-direction:column !important;
    }

    .modal-content{
        width:95%;
        max-width:95%;
        padding:15px;
    }

    .map-container{
        height:320px;
    }

    th,
    td{
        padding:10px;
        font-size:13px;
    }

}

/* Small Mobile */

@media screen and (max-width:480px){

    .hero h1{
        font-size:1.45rem;
    }

    h2{
        font-size:1.3rem;
    }

    h3{
        font-size:1rem;
    }

    .logo{
        font-size:.95rem;
    }

    .main-content{
        padding:10px;
    }

    .card{
        padding:12px;
    }

    .map-container{
        height:250px;
    }

    table{
        min-width:1000px;
    }

    .stat-info p{
        font-size:1.4rem;
    }
}

/* =================================
   ENGINEERING MOBILE FIX ONLY
================================= */

@media screen and (max-width:768px){

    .section-container{
        width:100% !important;
        max-width:100% !important;
        padding:10px !important;
        margin:10px auto !important;
    }

    .eng-grid{
        display:flex !important;
        flex-direction:column !important;
        gap:15px !important;
    }

    .eng-grid > div{
        width:100% !important;
    }

    .eng-site-list{
        max-height:none !important;
        overflow:visible !important;
    }

    #site-specs-card > div{
        display:flex !important;
        flex-direction:column !important;
        gap:15px !important;
    }

    .map-container,
    #eng-map{
        width:100% !important;
        height:280px !important;
    }

    .eng-card-buttons{
        flex-wrap:wrap;
    }

    .eng-card-buttons .btn{
        flex:1;
        min-width:120px;
    }

    #eng-customers-table{
        min-width:700px;
    }

    .card{
        width:100% !important;
        overflow:hidden;
    }

    header nav{
        flex-direction:column !important;
        gap:10px !important;
    }
}

@media screen and (max-width:480px){

    .map-container,
    #eng-map{
        height:220px !important;
    }
    .nav-links{
        flex-direction:column !important;
        gap:8px !important;    }

    .card{
        padding:12px !important;
    }

    h2{
        font-size:1.2rem !important;
    }

    h3{
        font-size:1rem !important;
    }
}



/* Actions Column */

#admin-sites-table th:nth-child(10),
#admin-sites-table td:nth-child(10){
    min-width:170px;
    width:170px;
    white-space:nowrap;
}

.action-cell{
    white-space:nowrap;
}

.action-cell .btn{
    display:inline-block;
    width:auto !important;
    min-width:50px;
    margin:2px;
    padding:4px 8px;
}


@media screen and (max-width:768px){

    .main-content{
        overflow-x:hidden;
        padding:12px;
    }
}

/* View Solar Sites - Always Horizontal Scroll */


.table-responsive{
    width:100%;
    overflow-x:auto !important;
    overflow-y:hidden;
    display:block;
}


#admin-sites-table th:nth-child(11),
#admin-sites-table td:nth-child(11){
    min-width:180px;
}

.table-responsive{
    width:100%;
    overflow-x:auto !important;
    overflow-y:hidden;
    display:block;
    -webkit-overflow-scrolling:touch;
}

/* ADMIN VIEW SOLAR SITES FIX */

#admin-view-sites{
    overflow:hidden;
}

#admin-view-sites h2,
#admin-view-sites p{
    position:sticky;
    left:0;
    background:#fff;
    z-index:2;
}

.table-responsive{
    width:100%;
    overflow-x:auto;
    overflow-y:hidden;
    display:block;
    -webkit-overflow-scrolling:touch;
}

#admin-sites-table{
    min-width:2200px;
    width:2200px;
}


.main-content{
    overflow-x:hidden !important;
}

#admin-view-sites{
    width:100%;
    overflow:hidden;
}

#admin-view-sites .table-responsive{
    width:100%;
    overflow-x:auto !important;
    overflow-y:hidden;
    display:block;
}

#admin-sites-table{
    table-layout:fixed;
    min-width:1600px !important;
    width:1600px !important;
}

#admin-sites-table th:last-child,
#admin-sites-table td:last-child {
    min-width: 180px !important;
    width: 180px !important;
}

.action-cell {
    display: flex !important;
    gap: 8px;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.action-btn {
    display: inline-block !important;
    visibility: visible !important;
}


/* WhatsApp Floating Button */

.whatsapp-float{
    position: fixed;
    right: 20px;
    bottom: 20px;

    width: 60px;
    height: 60px;

    background: #25D366;
    color: white;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 32px;

    text-decoration: none;

    box-shadow: 0 4px 12px rgba(0,0,0,.25);

    z-index: 99999;

    transition: all .3s ease;
}

.whatsapp-float:hover{
    transform: scale(1.1);
}

.whatsapp-float i{
    color: white;
}