sp1ti / TheTVDB.com 'light' theme (Version 3)

// ==UserScript==
// @name         TheTVDB.com 'light' theme (Version 3)
// @description  Ef' your eyesight. Some people don't like dark mode in 20-20. Also scale it down a bit...
// @match        https://www.thetvdb.com/*
// @match        https://thetvdb.com/*
// @author       sp1ti
// @supportURL   mailto:trakt.x.mal@gmail.com
// @downloadURL  https://openuserjs.org/install/sp1ti/TheTVDB.com_light_theme_(Version_3).user.js
// @updateURL    https://openuserjs.org/meta/sp1ti/TheTVDB.com_light_theme_(Version_3).meta.js
// @grant        none
// @version      0.4
// @license      MIT
// ==/UserScript==

// #1c7e3e = regular green
// #175527 = dark green
// #c3c3c3 = light grey
// #d8d8d8 = light grey (brighter)

function addGlobalStyle(css) {
    var head, style;
    head = document.getElementsByTagName('head')[0];
    if (!head) { return; }
    style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = css;
    head.appendChild(style);
}

// page general
addGlobalStyle('body { background-color: #fff; color: #000; }');
addGlobalStyle('a,a:hover,a:active,a:visited,a:link,a:focus { color: #1c7e3e; }');
addGlobalStyle('.required { color: #1c7e3e; }'); // =*
addGlobalStyle('a.thumbnail.active, a.thumbnail:focus, a.thumbnail:hover { border-color: #1c7e3e; }');

// forms (dropdowns)
addGlobalStyle('.form-control, output { color: #000; }');
addGlobalStyle('fieldset { border: 1px solid #d8d8d8 }');

// search bar
addGlobalStyle('div.searchbar { background-color: #d8d8d8; color: #000; }');
addGlobalStyle('.searchbar .form-group input.form-control { background-color: #d8d8d8 !important; color: #000; }');
addGlobalStyle('.searchbar .form-group button { background-color: #d8d8d8 !important; color: #000 }');

// pagination
addGlobalStyle('.pagination>.active>a, .pagination>.active>a:focus, .pagination>.active>span, .pagination>.active>span:focus { background-color: #1c7e3e; }');
addGlobalStyle('.pagination>.active>a:hover, .pagination>.active>span:hover { background-color: #175527; }');
addGlobalStyle('.pagination>li>a, .pagination>li>span { background-color: #d8d8d8; border: 1px solid #c3c3c3; color: #1c7e3e ; }');
addGlobalStyle('.pagination>li>a:hover, .pagination>li>span:hover { background-color: #c3c3c3; border: 1px solid #c3c3c3; }');

// lightbox
addGlobalStyle('a.btn.btn-primary.btn-responsive { color: #fff; }'); 

// toolbar
addGlobalStyle('div.page-toolbar { background-color: #c3c3c3; color: #000; border-bottom: none; }');
addGlobalStyle('.page-toolbar .crumbs a { color: #000; }');

// shrink-a-lot
addGlobalStyle('main, .container { width: 1000px; }');
//addGlobalStyle('main.internal { margin-left: auto; margin-right: auto; border-left: 1px solid; border-right: 1px solid; border-color: #c3c3c3; border-top: 0px; }');
addGlobalStyle('main { margin-left: auto; margin-right: auto; }');

if((window.location.href.lastIndexOf("translate") > -1) || (window.location.href.lastIndexOf("series") > -1) || (window.location.href.lastIndexOf("people") > -1) || (window.location.href.lastIndexOf("translations") > -1) || (window.location.href.lastIndexOf("genres") > -1)) {
  // translation edit form
  addGlobalStyle('th { background-color: #d8d8d8; }');
  addGlobalStyle('table { background-color: #fff; }');
  addGlobalStyle('table, th, tr, .table-bordered, .table-bordered, .table-bordered>tbody>tr>td, .table-bordered>tbody>tr>th, .table-bordered>tfoot>tr>td, .table-bordered>tfoot>tr>th, .table-bordered>thead>tr>td, .table-bordered>thead>tr>th { border: 1px solid #c3c3c3; }');
  addGlobalStyle('.panel-default>.panel-heading { background-color: #c3c3c3; color: #000; border: 1px solid #c3c3c3 !important; }');
  addGlobalStyle('.panel-heading { padding: 5px 15px; }');
  addGlobalStyle('h4.panel-title { font-size: 14px; }');
}

// language selector buttons active _ inactive
addGlobalStyle('.label-info { background-color: #1c7e3e; }');
addGlobalStyle('.label-default { background-color: #c3c3c3; }');
// series info table
addGlobalStyle('.list-group-item { background-color: transparent; border: 1px solid #c3c3c3; }');
// general tables
addGlobalStyle('.table-hover>tbody>tr:hover>td, .table-hover>tbody>tr:hover>th, .table-hover>tbody>tr:hover a, .table-hover>tbody>tr:hover a:hover, .table-hover>tbody>tr:hover a { background-color: #1c7e3e; color: #fff !important; }');
// season orders buttons
addGlobalStyle('li.active a.change_seasontype { background-color: #1c7e3e !important; }');
addGlobalStyle('li.active:hover a.change_seasontype { background-color: #175527 !important; }');
addGlobalStyle('li:hover a.change_seasontype { background-color: #c3c3c3 !important; color: #1c7e3e; }');

// toolbox 
addGlobalStyle('div.btn-group-vertical.toolbox { background-color: #1c7e3e !important; border: 1px solid #d8d8d8; }'); //header
addGlobalStyle('a.btn.btn-default.btn-lg { background-color: #d8d8d8 !important; color: #000; '); //table
addGlobalStyle('a:hover.btn.btn-default.btn-lg { background-color: #c3c3c3 !important; '); //table
addGlobalStyle('button.btn.btn-default.btn-lg.dropdown-toggle { background-color: #d8d8d8 !important; color: #000; '); //table
addGlobalStyle('button:hover.btn.btn-default.btn-lg.dropdown-toggle { background-color: #c3c3c3 !important; '); //table

// footer
addGlobalStyle('footer, .footer>.container>.row h5 { color: #1c7e3e; }');
addGlobalStyle('.footer a { color: #fff; }');
// donation button
addGlobalStyle('.btn-info, .btn-info a, .btn-info:hover, .btn-info:focus, .btn-info:active, .btn-info.active, .open>.dropdown-toggle.btn-info { background-color: #1c7e3e; color: #fff !important; }');
addGlobalStyle('.btn-info { border-color: #1c7e3e; }');
// social media buttons
addGlobalStyle('.col-xs-12.col-sm-6.footer-extra-top a { color: #fff;}');
// that random hr
$("hr").remove();

//remove ads and fixes for that - gone for now
//top banner
//$('.sponsor-area-top').remove();
//addGlobalStyle('.navbar { border-radius: 0px; }');
//addGlobalStyle('.series_header { height: 521px; }');
//tvtime block
//$('div.well.tvtime').remove();

//start page only
if(window.location.href == "https://www.thetvdb.com/"){
    // remove welcome splash
    $("img[src*='https://artworks.thetvdb.com/homepage/']").remove();
}